I’ve been testing the Nginx Image Filter Module with WPMU. So far it promises to save a lot of resources while delivering images for wpmu blogs at blistering speed.
The file at /wp-content/blogs.php uses a tonne of unnecessary resources and Nginx Image Filter Module can easily save this problem.
You need to set up two instances of Nginx. One which servers files as per normal and another instance with serves images.
The main server proxy_pass the request and args to the nginx_image server which sends them back resized. I will have a full write up soon but here is a preliminary setting for the Nginx Image Server.
This is the basic set up. I have not included the key ingredient for the main nginx nginx.conf file. More soon.
For image server set up extra nginx with this configure:
./configure --prefix=/usr/local/nginx_images --with-http_image_filter_module make make install cp /etc/init.d/nginx /etc/init.d/nginx_images (change any setting in the file /etc/init.d/nginx_images from "/usr/local/nginx" to "/usr/local/nginx_images" )
Extra conf for image server.
location /img/ {
set $width $arg_w;
set $height $arg_h;
proxy_pass http://127.0.0.1:80;
image_filter resize $arg_w $arg_h;
error_page 415 = /empty;
}
location = /empty {
empty_gif;
}
wp_generate_attachment_metadata
2 Comments
Hi
Can u point out the circumstances that blogs.php is unnecessary using resources?
olokkii, blogs.php uses php to serve static image files. Nginx can serve image files magnitudes faster while using much less cpu and memory.
One Trackback/Pingback
[...] Nginx PHP Nginx PHP Fastcgi Cache Php-fpm How To « Faster Nginx WPMU Image Processing [...]