Welcome Guest, Not a member yet? Register   Sign In
Ad serving app takes too much RAM


We are developing an ad-serving app which we host on a VPS. (CodeIgniter+MySQL)
The app is not using any auto loaded resources and we just use one controler/method to serve the ad.
By serve the ad, I mean that all we do is:

1) load a model and a library (for some regex manipulations);
2) make a simple SELECT to get creative's info
3) use load->view to load a template file
4) make INSERT DELAYED into the DB
5) print the loaded template html to the browser

The problem is that we have something like 100,000 hits per hour (in the peaks hours) and
we have problems with the resources it holds.

We started with 3GB of ram and it was ok for about 2 weeks. Then it started to give 500 Internal Server Error and the VPS guys told us
it uses all the RAM, so we increased it to 5GB and that fixed the 500 error. Then in 2 days they said that the 500 error is back and we increased the memory to 7GB and now we are running on 95% of it.

So can anyone tell me where the problem might be?

Every help is appreciated.


[eluser]Abdul Malik Ikhsan[/eluser]
1. you can use lucene search.
It save search/query rows into file(s) and can be faster than normal Query.
I use Zend Library named zend_search_lucene to do this.
to load ZF lib to your CodeIgniter Framework, you can read from my presentation :

2. Cache the data to file(s)

A decent vps with 7gb of memory should handle a load like that without any problems, that is if your running linux.
What webserver are you using? What database?

Is the 500 error because of the webserver not handling requests fast enough or is de database delaying requests and thus the webserver?

How well is the table indexed?

Theme © iAndrew 2016 - Forum software by © MyBB