I’m trying to squeeze ever possible source of latency out of my app. I’ve done some basic benchmarking and my total page load time is roughly 555ms. I’m trying to figure out what accounts for this time:
Pinging the server takes about 167ms and there’s probably very little I can do about that.
I used [font=Courier]register_shutdown_function()[/font] at the very beginning of my [font=Courier]init.php[/font] file and pass it the time. Then the shutdown function calculates the entire execution time and logs it to a file. Average is 23ms.
I compared load times between PHP5.3 and FastCGI and found that FastCGI was roughly 45ms faster. So I assume that the 45ms difference means the time to instantiate PHP? I don’t use FastCGI because load testing has shown that I get more errors, i.e. killed processes, at high loads. I assume this is because FastCGI uses more memory, but in my simple benchmarking, it only seems to use an extra 1MB or so.
Does anyone have any ideas on some part of the process which could account for some of the latency?
I know, I know. 325ms is not much. But 95+ of the requests to my site are these Ajax requests, so even a 10% increase in speed is actually beneficial. I’ve already cut out about 250ms and reduced DB connections to 10% of what they were previously.
45ms load php