Skip to main content
We are Brand SEO Beijing serving international business, your marketing partner, Contact us by mi@mgsh.com.cn

Analysis and resolution of the sudden Gateway Timeout of the website

I used Wordrepss to build a website. I worked overtime last night and went back very late. There was no problem with the website before I went back, but when I came this morning, the user said that he could not access the website.This time point is very coincidental. When the user suggested that he could not access the website, the time of the website error log was just right. It was as if everything was arranged. I just arrived downstairs in the park, received the user information, and checked It's a perfect coincidence.

emergency solution

I don't know the reason, I don't want to solve the problem, and I don't know the reason, so I didn't restart the server. After all, I encountered a time when the server was restarted and paralyzed. It was caused by an error), I chose to restart the website of the pagoda panel, shuh, okay.problem solved.

problem follow up

Ali work order optimization linux

I submitted the Ali work order synchronously, but I didn’t actually report much hope, because I always felt that the Ali work order was a fool, kicking the ball to the website code, and to the customer’s technology. I was inexplicably asked last time. The Ali work order asked me to look for a technology, but I didn't ask anything. How did I know that I was not a technology.

The patience and enthusiasm of Ali's work order this time exceeded my expectations. I said several times that it was fine and expressed my intention to close the order. This is sticky, help me analyze a little bit, then I will look at it a little bit, solve it, and add more Other possible analysis, if this buddy uses this ability to chase his girlfriend, it is incredible, the level is on par with me.

The solution is to optimize the linux kernel:

For Linux servers, you can also optimize the /etc/sysctl.conf file at the bottom of the kernel parameters.

net.ipv4.tcp_syncookies=1

net.ipv4.tcp_tw_reuse=1

net.ipv4.tcp_tw_recycle=1

net.ipv4.tcp_fin_timeout = This parameter value is configured appropriately (120 is two minutes)

That's it, the latter number is not actually determined, so you can look at the configuration yourself, save it after saving sysctl -p and load it, it will take effect.

Give me screenshots, be patient and in place.

Linux-Ali-Sysctl-p-screenshot

Linux kernel parameter adjustment: There are two ways to adjust the Linux kernel parameters

Method 30: Modify the content of the kernel parameter file under /proc. You cannot use an editor to modify the kernel parameter file. The reason is that the kernel may change any of these files at any time. In addition, these kernel parameter files are virtual files. exists, so it cannot be edited with an editor, but with the echo command, which redirects the output from the command line to the selected file under /proc.For example: set the timeout_timewait parameter to XNUMX seconds:

# echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout

The parameter changes take effect immediately, but after restarting the system, the parameter returns to the default value.Therefore, to permanently change the kernel parameters, you need to modify the /etc/sysctl.conf file

Method Two.Modify the /etc/sysctl.conf file.Check the sysctl.conf file. If the parameter that needs to be modified is included, modify the value of the parameter. If there is no parameter that needs to be modified, add the parameter to the sysctl.conf file.like:

net.ipv4.tcp_fin_timeout=30

After saving and exiting, you can restart the machine to make the parameters take effect. If you want to make the parameters take effect immediately, you can also execute the following command:

# sysctl -p

The above excerpts are from: Linux Server Performance Evaluation and Optimization (XNUMX) – Kernel Parameters – Tencent Cloud Developer Community-Tencent Cloud (tencent.com)

Tencent Cloud's documentation feels better and has been updated.

Background user feedback did not log out overnight

Technically speaking, there is no logout, there are cookies, there is a cache, there is a CDN, I have not checked this complexity in parallel, but through experience, or there is a technical cache, but why does the user action time out at the moment?

Not sure, so, based on the phenomenon, increase inactive logout to protect session from shoulder surfers and snoopers!

Added automatic exit reminder and automatic exit control.

Looking at it again, I always find different old and new problems. It seems that the role of website operation and maintenance is always indispensable.

Back to Top