Site was hit by meteorit

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
andribas's picture

Today our site (local news) was hit by users that would like to know whats going on.
I have set up 2 years ago dedicated server with memcached turned on and it works great but today.
Provider of data-center told that we have reached about 80 megabit incoming traffic in peak today, proc had about 76% load.

Drupal works as nginx -> php-fpm. When server became slow, i could ssh in server, inspect processes, even worked apache on separate ip - phpmyadmin, and nginx result in 502 error on server.

I think php-fpm was slow and could not deliver data from memcached, is there approach to work direct nginx + memcached without php in Drupal?

Sorry for English.

Comments

Isn't there a Drupal

mherchel's picture

Isn't there a Drupal meteorite deflection module???

I kid.. I kid...

But really???

You kidding but I have to

andribas's picture

You kidding but I have to take my daughter from kindergarten, because she scared, and my mother had broken window in kitchen, this is not a joke, really.
But your idea about module in Drupal is amazing!

Well, I'm glad you and your

mherchel's picture

Well, I'm glad you and your family are OK and safe!

What sort of server specs do

Circlefusion1's picture

What sort of server specs do you have? I think server prices (especially VPSes) have dropped since 2 years ago. An upgrade might be in order.

From what I've read, Nginx has some native caching features, including "microcaching".

The idea behind microcaching is to cap the amount of requests that can make it through to your app by letting nginx bear the brunt of your pageviews by caching content for a very small amounts of time (ie: 1 second or less).

From your app's point of view, it can only ever be hit by a maximum of 1 req/sec per page of content it needs to serve, so in wordpress terms, if everyone is hitting your front page or a specific post, the vast majority of requests can be served out of cache.

Varnish or/and Boost would

vabue's picture

Varnish or/and Boost would help you!

Greetings to Chelyabinsk! :)

Thank you for greeting! i did

andribas's picture

Thank you for greeting!
i did used boost, even allocated space in memory for that it didn't help.
what's the difference between varnish and nginx in that case?

Varnish can keep all your

vabue's picture

Varnish can keep all your cached data in RAM.

But if all bandswith of your channel are full — nothing, except CDN (yours or outsource) can help.

here the

andribas's picture

here the video
http://www.youtube.com/watch?v=b0cRHsApzt8

P.S. traffic was probably not incoming but outgoing, what does it matter? traffic is search from news

There was a meteor shower in

Mark Theunissen's picture

There was a meteor shower in Russia!

server is 2 xeon e5620 12 gb

andribas's picture

server is 2 xeon e5620
12 gb ram
4 hdd 15k/sec raid 10 with hardware raid

i think drupal could make the most of it)

CSS/JS Aggregration

mikeytown2's picture

I'm assuming http://uralpress.ru/ is the site in question. I would turn on CSS/JS Aggregation. If you have had issues with core's aggregration, I would give AdvAgg a try.

Thank you, the site is

andribas's picture

Thank you, the site is correct, after aggregation some features of site becomes broken. Do you think absence of cdn is the problem?

Core or AdvAgg

mikeytown2's picture

Did you have troubles with Core's or AdvAgg? If it was Core I would give AdvAgg a try. If it was AdvAgg then I would wait it out as the load should drop as the day is almost over.

I will try AdvAgg, we used

andribas's picture

I will try AdvAgg, we used Core aggregation and it didn't work properly.
As far as i know nginx could not use 76-80% of proc for delivering content.
Besides css and js not aggregated, it deliver images that rely on performance of hdd.
Suppose we have 10-20 pages that requesed frequently and other stuff so-on.
Didn't they get in hardware cash?
I had the situation when i try to upload image and it fails, in peak.
Nginx returned 502 error, but server was alive.
however, our providers was also get hit by meteorit, even cellular - so i can't exactly tell what's happened, and, of course, can't repeat this situation.

No Varnish required

perusio's picture

you just have to use all the features Nginx offers.

Think about a caching strategy.

  1. How much time do I want to cache: TTL of content.

  2. Is your traffic mostly anonymous?

The best place to ask Nginx + Drupal related questions is the Nginx Group.

TTL = 5 min Yes Thank you

andribas's picture
  1. TTL = 5 min
  2. Yes

Thank you for advice, placed question in that group.

Microcaching

perusio's picture

it's not a one size fits all. You can taylor it to your needs. So if it's a 5 min TTL, then set it like that.

  1. microcache zone conf;

  2. cache configuration to adapt to your TTL. Set:

    fastcgi_cache_valid 200 301 5m; # 5 minutes TTL
  3. Done.

Thank you! It seems this is

andribas's picture

Thank you! It seems this is exactly what i was looking for. I will try to config microcaching.