Error "HTTP 500" Reported During OpenStack Command Execution
Symptom
The following error message is displayed when the OpenStack commands are executed:
ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500)
This error occurs occasionally and irregularly.
Key Process and Cause Analysis
- Check the logs of the error-related components (such as Nova and Cinder). The following error information is displayed:
Figure 1 Error logs
- Run the following command to check whether the number of MySQL connections is close to 28,231:
netstat -a|grep mysql|grep "^tcp"|wc -l
Conclusion and Solution
Reduce the number of connections in the TIME_WAIT state. Perform the following steps:
- Temporarily configure kernel parameters related to TCP connections.
sysctl -w net.ipv4.tcp_tw_reuse=1 sysctl -w net.ipv4.tcp_fin_timeout=30 sysctl -w net.ipv4.tcp_max_tw_buckets=10000
- Modify the system configuration file /etc/sysctl.conf.
- Open the file.
vi /etc/sysctl.conf
- Press i to enter the insert mode and add the following content:
net.ipv4.tcp_tw_reuse=1 net.ipv4.tcp_fin_timeout=30 net.ipv4.tcp_max_tw_buckets=10000
- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Make the configuration take effect.
sysctl -p
- Open the file.
Parent topic: OpenStack