PHP Performance Question
Posted: Sat Dec 11, 2010 3:21 pm
Hi,
I am planning on coding an education website. (For reference it looks like w3schools)
Currently I am using a html file as my navigation. (menu) Since the website will be education related and I want users to post articles too, it will be a huge load for the database so I need some performance tips.
Right now the website is running on a VPS. It is not released yet so I couldn't test my website performance & reliability. We are planning about moving on a dedicated server, if the VPS cannot hold the website anymore.
Question 1
Everything in the website will be directly taken from database. (Mssql) Articles, links, navigation, anything. As for example, whenever a visitor connects to website, there will be a sql query gathering links for the navigation menu from the database. When he browses an article, there will be another query getting links for the navigation sub menu. There will also be a query to get article from the database.
What's the most professional way to code a website like this? What do you suggest?
Question 2
Articles are going to be saved in database. Probably they will be huge (PHP side alone will take like 1000 papers) so what's the best way to save them in the database? What kind of coloumn should we be using? (e.g varchar(max)) The maximum lenght I know is 8000 characters, probably it is not even enough for a single page.
Any suggestions on this?
Question 3
To get most performance as possible, should I be doing something like "Make a timer script, which automatically converts everything in database into html files every 24 hours, so when a visitor browses the PHP section, page automatically includes page_php_lesson1.html(which contains the information of database)" There will be less queries to the database, but will it improve my website performance greatly or there will be a minimal increase at all? Also, what's the performance difference between including a .html file with 50kb of text and doing a SQL Query and getting 50kb text with select command ?
Also a suggestion on this would be great.
Thank you.
I am planning on coding an education website. (For reference it looks like w3schools)
Currently I am using a html file as my navigation. (menu) Since the website will be education related and I want users to post articles too, it will be a huge load for the database so I need some performance tips.
Right now the website is running on a VPS. It is not released yet so I couldn't test my website performance & reliability. We are planning about moving on a dedicated server, if the VPS cannot hold the website anymore.
Question 1
Everything in the website will be directly taken from database. (Mssql) Articles, links, navigation, anything. As for example, whenever a visitor connects to website, there will be a sql query gathering links for the navigation menu from the database. When he browses an article, there will be another query getting links for the navigation sub menu. There will also be a query to get article from the database.
What's the most professional way to code a website like this? What do you suggest?
Question 2
Articles are going to be saved in database. Probably they will be huge (PHP side alone will take like 1000 papers) so what's the best way to save them in the database? What kind of coloumn should we be using? (e.g varchar(max)) The maximum lenght I know is 8000 characters, probably it is not even enough for a single page.
Any suggestions on this?
Question 3
To get most performance as possible, should I be doing something like "Make a timer script, which automatically converts everything in database into html files every 24 hours, so when a visitor browses the PHP section, page automatically includes page_php_lesson1.html(which contains the information of database)" There will be less queries to the database, but will it improve my website performance greatly or there will be a minimal increase at all? Also, what's the performance difference between including a .html file with 50kb of text and doing a SQL Query and getting 50kb text with select command ?
Also a suggestion on this would be great.
Thank you.