views:

47

answers:

0

Hello,

I've faced a difficultiest problem. Let's imagine that all images are stored on image storage running lighttpd web server. All images URLs like http://domain.com/image_id.jpg.

Before displaying this image I want to check if this image was protected or not. So, we should do something like this...

a) Request to webserver b) Getting image_id from URL c) Requesting image status by it's image_id from DB or from Memcache d) Depending on status decide what to do - show image or just show any kind of error.

We've tried to use XSendfile to implement this login, but we failed because of high load. At the moment image storage is getting about 2.500.000 image views per day and average load is 5-8 (without XSendFile). With XSendFile enabled average load has jumped to 30-40. (Yeah, sucks....).

Is there any ways of solving this problem?

Thank you. PS: sorry for my English.