The Show entries via JavaScript plugin is causing our server to have "memory exhaustion due to php coding" in the words of our hosting company. The page we were including the headlines onto receives several thousand hits an hour, which was enough to cause the problem. The server didn't crash, it was just so bogged down with processing it couldn't serve pages.
If I find out any more on this end, I'll pass it along.
Show entries via JavaScript cripples server
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Show entries via JavaScript cripples server
Hi!
Yeah, the show entries plugin can definitely cause performance issues, especially when the script is being requested a couple of thousand times.
The only thing that helps is upgrading your server power, or looking into database tuning (caching etc.).
The PHP coding of the plugin itself is actually not bad; it's just that fetching all entries with parameters and formatting them is the most database intense query that can be performed at all.
You would have the same problem if all thousand sites requested your RSS feed(s)...
Sadly the JS can not use HTTP Conditonal GET (aka 304 caching), because the JS is requested client-side on foreign sites, so it would not really make a difference...
Best regards,
Garvin
Yeah, the show entries plugin can definitely cause performance issues, especially when the script is being requested a couple of thousand times.
The only thing that helps is upgrading your server power, or looking into database tuning (caching etc.).
The PHP coding of the plugin itself is actually not bad; it's just that fetching all entries with parameters and formatting them is the most database intense query that can be performed at all.
You would have the same problem if all thousand sites requested your RSS feed(s)...
Sadly the JS can not use HTTP Conditonal GET (aka 304 caching), because the JS is requested client-side on foreign sites, so it would not really make a difference...
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
As a fix, we've added a perl script on a 10-minute cron that reads the output from the js files and creates a flat file that a new js call on the external site can pull in to show the entries.
This might be something worth exploring as a plugin. It doesn't allow for the immediate display of new entries, but it does reduce the server load substantially.
We'll probably have to do the same thing if our RSS feeds become popular.
This might be something worth exploring as a plugin. It doesn't allow for the immediate display of new entries, but it does reduce the server load substantially.
We'll probably have to do the same thing if our RSS feeds become popular.