Friday, January 28, 2011

Server load effect upon Nginx redirects vs. serving of static pages

Based on experience, would someone please tell me how server load affects the ability of Nginx to redirect vs. serve a static page? Also, does this ability vary depending on the cause of the high server load (I/O, CPU, etc.)? Thanks.

  • For simplicity's sake, let's assume Nginx isn't causing the high load itself. Also, I'm assuming that by "redirect" you mean returning a 300-series status to the browser.

    If the server load is due to high-CPU processes, it's going to affect both redirects and static serving, because Nginx itself will be CPU-starved.

    If the system is disk I/O bound, redirects will be much faster than serving static files, because those requests don't need to wait for the disk. (Static files cached in memory, e.g. with memcached, would be less vulnerable.)

    Likewise if the system is memory-bound, Nginx in general will slow down (everything will, as the system approaches swap hell) but redirects are likely to respond faster than serving static files from disk.

    From pjmorse

0 comments:

Post a Comment