📜 ⬆️ ⬇️

Smart sessions

Solve performance problems.

Initial data.
We broadcast football matches via the Internet. Visitors: 5,000-10,000 on regular days, 100,000-150,000 on match days.

In the data center

Problem
With a large influx of visitors, the local network is overloaded due to the large number of calls to the memksh. Aggravating factors : 100 Mbit network, both pools on the same servers.

Solutions

Today we will talk about the technology of smart sessions, which we used to reduce the load.
')
What is the essence of technology

  1. We do not create a session if it is not really needed.
  2. We do not update the session in the repository, if it has not changed.

In fact, our site is paid, even if we have 150,000 unique per day, then there are really few people willing to pay. Visitors are distributed approximately as follows:


Implementation

Since we use memkesh, we already have a Session object, which overloads the standard session functionality and allows us to store the latest in memkesh. Additionally we do the following:


Voila, partially the load on the network is reduced, on memkes too. Then they switched the caching of parts of the blocks to local web servers and were able to wait for the visitors to decline painlessly, after which they increased the network bandwidth.

Comments are welcome.

UPD : The essence of the post is not to show me how cool I am, but the fact that there are trivialities in PCPs that are so mundane that we stop paying attention to them, and in fact sometimes they are not too thought out and have an impact on performance.

Source: https://habr.com/ru/post/62412/


All Articles