Serving static content under a heavy load

0 like 0 dislike
On one project the authorities came up with to give affiliate websites banner + small JS file (when clicking on the banner, the script gets the current coordinates of the user and throws on our website with them in settings). Banner + JS is a BN package. For each partner can be different or only their own packages.
And the problem is that the first partner has 2.5 million uniques a week. And plans several more partners to find, i.e. the load will rise immediately and by a lot.

And here is the problem of how to organize such a distribution in the best way?
The project is written in PHP.
Alternatively, we considered a CDN, but we have all the same logic is present, only show a certain number of times, the ability to pause, etc.
Searching the web, I found a good presentation

In the end, came up with the following system. And it would be desirable to hear opinion of experienced habravan as a valid solution, and perhaps there is something more elegant.


SS – the Server is static, stores, and distributes static
LB – load balancer to start probably software.
MS – (Main server) Server is the main project
CM (Content manager server). The management server SS'AMI receives commands from the MS and sends commands to the SS.

Message types



  1. To store, remove and serve content BN
  2. Each installed Nginx, PHP, database MemcacheDB. All have the same configuration software
  3. Also has access to a database MemcacheDB on CM
  4. In our own MemcacheDB stores the current counters and statuses for all BN and periodically sinhroniziruete them with CM
  5. Has a set of scripts to handle incoming messages from CM

  1. Also stores the master copy of all current BN's
  2. Installed Nginx, PHP, database MemcacheDB.
  3. Can receive messages from the MS and send to SS
  4. SS can synchronize with the internal set BN's
  5. Leads the overall table for all BN's, with counters, current statuses, etc.
  6. Also maintain a table available (the IP ?) addresses all SS's. In the case of addition/removal SS'and in principle should be enough to add/remove the address in this table.

Such an alignment. Experience is unfortunately not enough in this kind of task, very interested in the opinion of habenaria.
May not steamed and go to cloud hosting? Or such loads there is a hefty price increases?

Thanks in advance!
by | 8 views

3 Answers

0 like 0 dislike
Something has driven you.
If partners distinguish about you, can easily withstand this load, give it to them for safekeeping banners and js file.
0 like 0 dislike
You can save on LB by the transfer of load to DNS or Routers.
To give with stats.
Do not see problems 2.5 million (though it is not clear how many hits will), the average dedicated server with no problems will stand — it's small banners with them directly to give, the problem will be only in the OS settings and channel width.
If it hits, it is only 56 hits in a second (two files) — even Apache can handle it, I'm not talking about nginx.
Balk You will only be the width of the channel and the performance of the OS and the network card.
0 like 0 dislike
One dual processor ( 2 Xeon 2.4 Ghz, since the Pentium-4 ) Linux, Debian 4.0 + Nginx SCSI to withstand 100 million outputs the statics of a day. Now and much faster processors, and SSDS appeared.

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked Mar 24, 2019 by betal
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
32,904 users