Home > Net >  [urgent] problem solving performance
[urgent] problem solving performance

Time:03-12

Made a live interactive functions: grab a red envelope
function logic is as follows:

To a point in time, the screen will appear the effect of red rain, participate in live users to click on the red envelopes, the cumulative number of red convertible into cash, directly into their WeChat account,


encounter bottlenecks:

A large number of users in the grab a red envelope at the same time, the server CPU will soar sharply, cause the entire page are jammed, even server goes down


server configuration:

Web server: WinSvr 2008 r2, 30 m bandwidth, 16 core CPU, memory and 32 g

Database server: WinSvr 2008 r2, 1 m bandwidth (network connections), 16 core CPU, memory and 32 g

program implementation logic

By client-side scripts record users get the red envelope number stored in the local cache, rob again after the call server interface to calculate bonus amount the bonus amount, due to the last hair red envelopes,

Great god gives better optimization of all stripes above,

CodePudding user response:

Users in 1500 ~ 3000

CodePudding user response:

We no matter how much you users

Since be robbed, the spell is "luck", so can not enter the server formal operation is also luck

So, to be a "token bucket current limit", get the token into the, didn't get the token, chuck does not handle directly

CodePudding user response:

Answering such questions, the actual line we deal with our problems, with blog garden on the tall rolling technology in great god is not the same as

They tell you what is inside the volume, how to plug door,

We tell you is that how to look, how to study with other industries,
Java, go, is not even the industry learn
How can such as: water conservancy expert,
You this question and water conservancy experts, if the flood, how to protect the downstream

1. Reinforce the downstream dam
2. To build a bulwark against
3. The construction of water diversion dam, computation,
4. Establish flood zone
5. Use the above all facilities, capacity adjustment, shunt, peak, peak, abandon the scheduling methods such as water

So to borrow from others play thousands of experience
1. Reinforce the downstream dam -- -- -- -- -- -- -- -- -- -- -- - improve your existing processing logic, as far as possible to reduce the CPU
2. To build a bulwark against -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- use of mq, kafaka, redis, first the data into the reservoir, and then passing the dam scheduling
3. The construction of water diversion dam, computation -- -- -- -- -- -- -- -- -- -- - the use of API gateway, shunt, fusing
4. Establish flood zone -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - using the token bucket, bucket for current limiting abandoned water
5. The use of all facilities for -- -- -- -- -- -- -- -- -- -- -- -- -- -- the use of all the above received, traffic scheduling

CodePudding user response:

Volume inside the great spirit is mainly in
Reinforce the downstream dam -- -- -- -- -- -- -- -- -- -- -- -- to improve your existing processing logic, as far as possible to reduce the CPU
Here to play

But thousands of years of experience tells us that the flood that actually limited,
All dynasties of Chinese history are constantly reinforcing the embankments, but did not if they cannot forgive, flooding (the ans series, always in the embankment, trim the levees, flood, flood)

But after the modern comprehensive water conservancy project, this kind of circumstance is good a lot, so our advice is, comprehensive management and scheduling, rather than merely reinforce the dam is discussed

CodePudding user response:

2000 people request a interface problem is...

I think is a problem of "grab a red envelope" code...
  • Related