Problems, need help? Have a tip or advice? Post it here.
19 posts Page 1 of 2
I have a password protected image gallery. I recently made one with 258 images. The index folder page thumbnails load fairly fast, but the individual pages take forever and sometimes throw php fatal memory errors. I increased the memory using a php5.ini file in my root directory, which solved the issue, but the pages still take forever to load.

I have godaddy shared hosting, with three sites on one account. Is that the real issue?
Hi,

Shared hosting would mean not your three sites alone - your site is likely to be coexisting with numerous others on the same server and contending for the same resources (database being the worst bottleneck).

Try turning caching on (from config.php) and then access the pages while not logged in as admin.
It should make a big difference as basically you'll be getting plain static pages with no Couch or the database involved.

If even that does not help, it is time for you to look for a better host :)
What hosting would you recommend, VPS? I suspected it was more a host issue. I'll have to try out a gallery this huge on my development server tonight.

The gallery is private, will being logged in as an authenticated user have the same effect?
I'll have to try out a gallery this huge on my development server tonight.
That would give a fair idea about the load time.

The gallery is private, will being logged in as an authenticated user have the same effect?
Logged-in users are never served cached contents so turning the cache on will not help, I'm afraid.
Wouldn't caching only apply after the page has loaded? Initial loading would slow, right?

I'm kinda curious about this, why is a big gallery so slow when a small one isn't?

When I'm looking at my page as a logged out user - is the site not using the database actively?
With caching turned on, when a page is requested by a *non-loggedin* user, first the cache is checked for a static copy of that page. If one is found, it is served and the request ends.

If, however, a static cached copy is not found, the page is generated the usual way and a copy of it is saved in the cache for the future requests.

So, except for the first request, every other time only the static copy is served. No database is involved.

Wouldn't caching only apply after the page has loaded? Initial loading would slow, right?
As explained above, caching is a one-time affair (until the cache is invalidated by changes in the admin-panel). So the first-time the loading would be the same as a normally generated page. Every other time it should be discernibly faster.

I'm kinda curious about this, why is a big gallery so slow when a small one isn't?
That would also depend on your coding. Single pages (page-view) shouldn't ever be a problem. Listing pages (home-view, folder-view) can get slower if you use cms:pages to fetch in hundreds of pages in a single go (should use pagination to fetch only a reasonable number of pages on a single page e.g. 50 or 100).

From what you reported, you are seeing the opposite of this - your folder-views are fine. It is the page-view that is slow which is puzzling.

When I'm looking at my page as a logged out user - is the site not using the database actively?
Yes. But only when caching is on because then the logged out user is served a static HTML file - no database hit is involved at all.
My page views do include thumbnails, all of them. I deleted the code generating them, but the pages still loaded slowly, and these images are compressed for the web, lower resolution (about 200kb).
Please test the site on your local system, as you planned. It'll give you a baseline to compare with.
KK wrote: Please test the site on your local system, as you planned. It'll give you a baseline to compare with.


I tested the site in my virtualbox development server, it does run faster than my shared hosted site, but it still slows down considerably with many images added to a gallery. Is there anything I can do with my own server to speed it up? Aside from the server side, perhaps ajax on demand loading? That just came to my mind :)

Thanks KK!
I suggest you please try and locate the exact bottleneck first - e.g. use the 'network' panel of Chrome and see how much time it takes for the HTML page to be delivered and how much time it takes for the final rendering.

We are trying to figure out if it is a Couch specific problem or a very generic problem related to the way the page is structured.

If you find that the time taken server-side by Couch is high, we need to take a look at the template code and find which part of it can be optimized.

If, however, the reason is something else then we'll need to take the regular web page speed optimization steps - but that is not a Couch related issue.

Finally, if your hosted site is online please grant me access to it as I'd like to study the problem by myself.

Thanks.
19 posts Page 1 of 2
cron