![]() |
|
Zenphoto time to first byte - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Zenphoto time to first byte (/thread-12139.html) |
Zenphoto time to first byte - kilroy - 2014-12-17 Hello, I have a Zenphoto website at www.france-in-photos.com with about 2000 images (700 unpublished), 177 albums and a number of tags. Memory and processor use for the last month. I recently realized that my Zenphoto site was slow to load, mainly because of a high time to first byte. My Zenphoto site homepage has a time to first byte of 3 seconds I have tried to remove some of the features on my theme (such as the tag cloud), refresh the database, raised the PHP memory limit to 512 Mb. None of these get the time to first byte under 2 seconds. How can I improve performance? Zenphoto time to first byte - acrylian - 2014-12-17 Hard to tell exactly. Do you use the html_static_cache plugin? What slows down mostly is the image generation but that of course only on the first visit (unless you have setup your theme to use the cacheManager plugin to precache all possible sizes). The front pages seems indeed a bit slow. According to Safari the slowest parts are external scripts and font loading: http://zenphoto.maltem.de/test3/scripts.jpg.html Also the boostrap.css is 120k big. One drawback of such complete frameworks that it carries a lot stuff you probably don't need. Zenphoto time to first byte - kilroy - 2014-12-18 Yes, I do use the static_html_cache plugin. The bootstrap CSS does take a while to load. Gzip is not enabled on my server and it may speed up things for this kind of file. Here is a waterfall view of a test I just did with WebPageTest. The time to first byte is rather extreme at 10s. I generally get 3s. You can see that the major delay is due to calculations that take place BEFORE the page starts to render. My question is about the calculations that take place at that time: tag cloud, latest images and menus (on the homepage). How does a large number of images and tags increase this? And is my server large enough to handle this? I wondered if the server had been hacked and was being used to calculate other things, but did not find anything. I stopped the email service, just in case. I stopped some of the smaller websites running on it, but it did not change anything. I would be interested to see examples of other websites running Zenphoto to see how they fare on that respect. Zenphoto time to first byte - acrylian - 2014-12-18 If you use big images (high resolutions) as originals the image generation may of course eat up your RAM. That is noted here: http://www.zenphoto.org/news/problems-with-albums-and-images We of course cannot tell about your custom theme or your server. But note if you don't run your own self managed server raising the memory limit may be reported false. On shared host you are most certainly not allowed to do that at all. Of course the more you have of albums/images the more work needs to be done to do things. Tags are in their own tables and if counted those are used. You find other sites on our showcase for example but of course there are a lot of old installs there. To compare here are the stats of our own site: Memory limit is 192 MB but note that we run our own costly server. And we don't use the html cache currently. Edit: Please check that the static_html_cache plugin is really working correctly, e.g. that cache files are created in /cache_html/ at all. Your source code should have a line like `` if it is working but it haven't. That could be a permissions issue and such can slow down naturally. Review your server error logs. You also have a JS error from a script that might be add up, too. Zenphoto time to first byte - kilroy - 2014-12-18 Thanks for all those hints. I use rather small images (650 px wide), so I don't think it is the problem. A friend of mine is checking the VPS as the issue is probably there. Performance dropped noticeably on the 15th of December without any important change on the website. Zenphoto time to first byte - acrylian - 2014-12-18 Ok, let us know if you find anything out. Zenphoto time to first byte - kilroy - 2014-12-21 After a series of changes, we have been able to reduce the time to first byte significantly. We started with a TTFB of 3s
This brought us to under 2s of TTFB
The TTFB is now under 1 second. It would be nice to bring it to 0,5s, but I think I would either have to change the design (by removing calculation heavy modules such as the tag cloud) or double the VPS memory. There is very little traffic right now, so it may degrade again with a higher traffic. Zenphoto time to first byte - acrylian - 2014-12-21 The first page now shows `` which is quite good I think. I still wonder if the static_html_cache is working correctly on your site as if it should be listed there as well (I see the plugin is active). Of course both the tag cloud and the latest images do some stuff to actually be able to display what they do. The latest images stuff does do some check so it does not display things from unpublished or protected albums (the tag could in 1.4.6 does not). Zenphoto time to first byte - kilroy - 2014-12-22 I think the cache works as the cache_html directory has files in it. I guess the next step to get better performance would be to upgrade the server. Zenphoto time to first byte - acrylian - 2014-12-22 Ok, good. We can of course not exclude that there might be room for improvement in some places. We gladly try to solve such if pointed to and if possible. But at some point a server upgrade could be the best choice. |