Forum Moderators: phranque

Message Too Old, No Replies

nginx and apache - using nginx to serve images

         

belfasttim

10:04 pm on Jun 28, 2009 (gmt 0)

10+ Year Member



Hi-- I run a few websites for real estate that are very image intensive-- some listings have 50-60 decent sized images.

Lately I've been running into issues with my server swapping heavily and getting pretty bogged down. Some googling led me to a possible solution-- using nginx to serve the static images, while proxying apache to serve php pages. (I did subsequently tweak apache to create fewer processes and timeout connections more quickly, which I think is helping).

Would anyone like to share opinions on this? I realize upgrading my server to one with more RAM is the obvious (and desirable) option, but until the income is more steady this is not ideal.

If you think this approach will work, be advised I'm hosting the images in an Amazon S3 bucket, run as a cnamed subdomain from my site (images.mysite.com). I'm not exactly sure how to configure nginx to serve these images, since the files are not local.

Thanks for any help.

encyclo

12:08 am on Jun 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure I follow you, if you are serving the images off a separate server already, why would those same images be bogging down your primary server?

belfasttim

1:17 am on Jun 29, 2009 (gmt 0)

10+ Year Member



Hi encyclo-- thanks, and you're right of course. The static files would be css, js, as well as local images.

As for the subdomain-- I typed before I'd thought that through I guess.

Has anyone had any experience with this type of setup? Is it worth trying nginx with fastcgi to serve the php files rather than apache?

Thanks