Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Nginx or Apache

edited April 2013 in Miscellaneous

Do you guys recommend Nginx or Apache? I have experience with both. i believe Nginx is much more robust and lightweight but we have had issues with WP plugins in the past that use the wp-cron feature. Cronjobs would stop after a few hours. We have a specialized plugin that we use to pull CSV data into the wp database that can literally run for 5 to 7 hours. We tried it on Apache and our plugin worked fine but no matter what edits we made to the options on Nginx we always had issues with the plugin erroring out. We messed with php-fpm options and core php options. 3 different "experts" looked at it and no one could correct the issue. I'm not sure to this day if it was more of a WP issue or a Nginx issue but either way the problem went away on Apache. Any thoughts or feed back would be greatly appreciated. We are just laying out a roadmap right now for plans to move all of our sites to elefant from wp. Thanks for all the great help!

Comments

  • I generally opt for nginx whenever I can, since it's been faster and easier to manage (even though I'm still more familiar with Apache's config file nuances).

    If you're running a cron job though, it shouldn't go through Apache or nginx at all. You can call an Elefant handler using PHP in CLI mode fron Cron like this:

    * * * * * cd /var/www; php index.php myapp/handlername
    

    From there, your script is on its own to do its thing, although it still has all the Elefant stuff available too. For long running cron scripts, you'll need to call set_time_limit(0); but otherwise it should work just like any command line PHP script. Here's the page in the docs about CLI usage:

    http://www.elefantcms.com/wiki/Command-line-usage

  • We set set_time_limit(0) on our previous WP plugin and changes several time out settings in php-fpm/cli/nginx etc. The plugin still timeout. I have to believe it was a WP issue.

Sign In or Register to comment.