WordPress.org

Ready to get started?Download WordPress

Forums

Nginx
[resolved] Plugin performance (9 posts)

  1. andrebazaglia
    Member
    Posted 1 year ago #

    Hello,

    Currently, I run nginx configuration as Nginx recommends – really simple and default setup with "try_files $uri $uri/ /index.php?q=$uri&$args;" to enable pretty URL's in WordPress. My website is working fine with this settings (nginx + W3TC + Xcache + Varnish) for a long time, and today I found your plugin.

    I see that in your set up tutorials (http://rtcamp.com/wordpress-nginx/tutorials/) you recommend using WordPress + Nginx + fastcgi_cache. As it's the first time I read about fastcgi_cache and have no experience with it, my question is:

    -> May I try that combination (WordPress + Nginx + fastcgi_cache + this Nginx Helper Plugin) for best performance? This is also keep working fine with any PHP opcode (like APC or Xcache) and Varnish?

    Thanks!

    http://wordpress.org/extend/plugins/nginx-helper/

  2. rahul286
    Member
    Plugin Author

    Posted 1 year ago #

    PHP opcode cache and Nginx fastcgi_cache can be used together. They serve different purpose.

    We use W3 Total Cache's mysql and object cache with PHP's APC storage.

    Page-caching is turned off in W3 Total Cache. We use Nginx's fastcgi_cache for page cache.

    You will need nginx-helper if you are using fastcgi_cache. You will also need to install/compile nginx with nginx-cache-purge module. This is covered in this article - https://rtcamp.com/tutorials/nginx-wordpress-fastcgi_cache-with-conditional-purging/

    As far as Varnish is concerned we do not use or recommend it with Nginx. Varnish is good when used with Apache. With Nginx, its not worth extra time we spend on it.

  3. rahul286
    Member
    Plugin Author

    Posted 1 year ago #

    By the way, I forgot to add:

    My website is working fine with this settings

    If all is working nicely, its better to stick with it :-)

    If it ain't broke, don't fix it!

  4. andrebazaglia
    Member
    Posted 1 year ago #

    Hi, firstly, thank you very much for the fast reply!

    If all is working nicely, its better to stick with it :-)

    If it ain't broke, don't fix it!

    Haha, really? It's working fine, as I said, but performance isn't really as great as it could be, you understand? I liked what you said about Varnish, as it doesn't seems to make any great performance improvements and is using a lot of CPU/RAM.

    I will just stop using Varnish in order to compile nginx with fastcgi_cache and use nginx-helper.

    So, to clarify things, the best settings may be:

    1) Disable Varnish, because as I said before, the performance gains with Varnish enabled is really low.
    2) Keep using W3TC to Mysql/object cache only? And what about page cache and browser cache, both must be disabled?
    3) Configure fastcgi_cache with nginx-helper just like your tutorial?

    That's just it?

  5. rahul286
    Member
    Plugin Author

    Posted 1 year ago #

    It will be better if you try - https://rtcamp.com/tutorials/wordpress-nginx-w3-total-cache/

    For page-caching, Nginx's fastcgi_cache and W3 Total Cache do not differ much in performance. But it much more easier to use w3 total cache.

    You can still use Nginx Helper to remove index.php from permalinks.

    That being said, I use Nginx's fastcgi_cache for some other reasons:

    • It "feels" faster.
    • I keep playing with server, so many times I need to deactivate w3 total cache. In-such cases where I forgot to reactivate it, nginx's fastcgi_cache still keeps doing its job.
    • If any plugin is not playing nice with w3-total-cache, I can deactivate w3-total-cache.
    • W3-total-cache do not have multisite support (its in beta). On multisite Nginx's fastcgi_cache is much easy to setup. Add few lines in nginx and all current, future sites in multisite will atleast have page-cache
    • For other plugin like woocommerce, I prefer editing nginx-config rather than figuring out caching-plugin settings to control caching mechanisim

    Please note, its hard to decide for once which is faster among Nginx fastcgi_cache, w3-total-cache or even wp-super-cache. Choose one which is more comfortable and does the job.

    In any case use an op-code cache, a page-cache and object/mysql-cache for best performance. Always have browser cache (configure it from Nginx).

  6. andrebazaglia
    Member
    Posted 1 year ago #

    Thanks again! I will try exactly as you said. In the post you have written, you ask to disable Browser Cache, that's because nginx do this work? As your post doesn't shows how the "http {" must be configured, just shows the "server {", I will paste here how I have configured gzip in nginx, is it okay or may I also change something?

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';

    access_log off;

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    server_tokens off;
    gzip on;
    gzip_static on;
    gzip_comp_level 4;
    gzip_min_length 1024;
    keepalive_timeout 65;
    limit_zone myzone $binary_remote_addr 10m;
    client_max_body_size 10M;

  7. rahul286
    Member
    Plugin Author

    Posted 1 year ago #

    I am not able to recall clearly but Nginx repo I use comes with gzip on always in config.

    I will recheck it on next setup.

    By the way - I use http://www.whatsmyip.org/http-compression-test/ to test if gzip is enabled.

    Other things I look for are - https://rtcamp.com/tutorials/checklist-for-perfect-wordpress-nginx-setup/

  8. andrebazaglia
    Member
    Posted 1 year ago #

    Okay! I just like to say thank you for all the attention! I liked all your posts and your plugin! ;)

  9. rahul286
    Member
    Plugin Author

    Posted 1 year ago #

    My pleasure. Glad to know that. :-)

    I will be revamping all nginx tutorials later this month. Sort of version 2.0.

    As of now sometimes they become hard to navigate....

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.