Query exception laravel 5.4

2019-08-27 14:15发布

When i will do a login sometimes on my laravel application i face this error: Error

Someone knows what could be this?

PS: this not happen all times;

I'm using xampp on a x64 machine with windows 10 home, with a core i5 processor, and 8 GB of RAM. Also using a virtual server to run on development mode.

标签: laravel-5.4
1条回答
做自己的国王
2楼-- · 2019-08-27 14:45

The error actually does not come from MySQL, but from Windows itself:

When a connection is closed, on the side that is closing the connection, the tuple {Protocol, Local IP, Local Port, Remote IP, Remote Port} enters a TIME_WAIT state for 240 seconds by default.

In this case, the protocol is corrected - TCP

Local IP, Remote IP, and Remote PORT are also typically fixed. Therefore, the variable is the local port.

What happens is that when you do not bind a port in the range 1024-5000 is used. So, roughly, you have 4000 ports. If you use all of them in 4 minutes - meaning that you make 16 web service calls per second for 4 minutes, you will exhaust all ports. That is the cause of this exception.

In other words, you ran out of doors in the dynamic range. This probably should not be happening.

how to fix: To set TcpTimedWaitDelay (TIME_WAIT): Use the regedit command to access the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\TCPIP\Parameters registry subkey. Create a new REG_DWORD value named TcpTimedWaitDelay. ... Stop and restart the system.

查看更多
登录 后发表回答