MyBB Community Forums

Full Version: edit syndication.php to lessen server load
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
what are the lines to be editted to make our rss feed link less server load?

how to make it very simple or less query if it will crawl or flooded by rss graffiti, dlvr.it, feedburner, pingomatic, etc?

any techniques?


thanks
If the feed is being hit a lot from multiple different sources the best idea I can give you is that you cache a static version of it.

Nginx (docs, DO tutorial) and Apache (docs) both have support for caching the output of PHP, or you could use something separate like Varnish, but that will take a lot more work.

You could even build a small MyBB plugin that will purge the cache of the feed whenever a new thread is made.



If you don't want to do that then you could try and profile the syndication.php file and find that slowest sections and work on cutting them down. Some options here: http://stackoverflow.com/q/21133, personally I'm a fan of Xdebug and Webgrind.

From a quick look the file doesn't seem to do a lot, but it will execute all the global plugin hooks, so unless you have a need for plugins to be executing things on the feed then you can try define("NO_PLUGINS", 1); up the top to stop it loading them. YMMV.
i am using apache + varnish cache and still the load goes up Sad

100% the coders of mybb are not noticing this issue

Quote:You could even build a small MyBB plugin that will purge the cache of the feed whenever a new thread is made.

how???????????????????????????????? Sad
(2014-04-20, 04:26 AM)KANTUTAN Wrote: [ -> ]
Quote:You could even build a small MyBB plugin that will purge the cache of the feed whenever a new thread is made.

how???????????????????????????????? Sad

Here is some information on purging URLs from Varnish through PHP: https://www.varnish-software.com/static/...he-backend

You'll just need to make that cURL request when the newthread_do_newthread_end hook is run.

Out of interest, what kind of hit rates are you seeing for syndication.php? varnishtop -i txurl should tell you that. Also take a look at varnishlog, maybe there are people requesting syndication.php with extra parameters so the cache is being skipped.
i will check the log later and will try your suggestion.

+ rep for you

thanks

i hope that this code will optimize by our mybb developers

Sad