Forum Moderators: coopster
I have effectively made the transition from running a static portal over to one served up through PHP. While the accessibility and content management aspects of the site have greatly improved, I have also begun to push the limitations of my hosting plan for a specific web site.
In particular, the amount of data transferred to through the account has increased some 30% on a daily basis compared to the averages from just one month ago. Traffic levels are very similar, as is the number of visitor sessions and page views. Essentially nothing has changed aside from the static pages are now generated in PHP.
Another aspect I've noticed, is the overall processing and load time for the user experience. Pages that once loaded quickly are lagging behind a second or two more than they once did. While that's not a long time in general, it is an incredibly long time for first time users of the site.
Because of these findings, I've begun researching various ways to decrease the amount of code needed to render the same results. Since I'm a newbie to PHP and mySQL connections, it is difficult for me to know where to look.
So, I'd like to see what some of the forum members here have learned over time when it comes to optimizing PHP scripting to enhance the user experience and server load.
Any suggestions or findings you'd like to share?
My argument would be PHP is designed to be executed quickly so if its not, and assuming that you've followed good coding practices and your PHP environment is well implemented, don't try and minimise the use of your tool, just take a different approach.
This thread on scalability [webmasterworld.com] may help.
I am not sure what other tricks you may have already tried:
1. I personally don't know what effect things like loop unrolling can have - someone else care to comment?
2. Check out this page: xdebug.derickrethans.nl as it will allow you to profile you code and see where the delays are occuring.
asp
[edited by: jatar_k at 2:19 pm (utc) on May 29, 2003]
[edit reason] delinked [/edit]
The short answer on INDEXES is this: The more indexes you have the faster your SELECTS will run(unless you index every column), but the slower your INSERTS and UPDATES will run. Now that is a DRASTIC oversimplification, but you kind of get the picture. You can also build multi-column indexes as well and in some cases this may be a better choice than a single column index.
Scott Geiger
After that you can easily pin-point the bottlenecks.
There's obviously other things you can do, but I guess that's a start.
mavherick