Mysql has gone away error randomlyFixing “MySQL server has gone away” errorpython mysqldb - mysql server gone away - can't reconnectIntermintent slow MySQL ConnectionsMySQL not accepting connections from WPMySQL lowering wait_timeout value to lower number of open connectionsError 2006: MySQL server has gone away'PDO Connection Error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'2006: MySQL server has gone awayMySql Clients connection timeout randomlyHow to fix mysql has gone away, high writeiops, switch to postgres?

Why does Linux list NVMe drives as /dev/nvme0 instead of /dev/sda?

Are all instances of trolls turning to stone ultimately references back to Tolkien?

When to remove insignificant variables?

When two first person POV characters meet

Interaction between Leyline of Anticipation and Teferi, Time Raveler

How do I handle a table mixing up the DM and the players' roles too often?

What does "play with your toy’s toys" mean?

Is this proposal by U.S. presidential candidate Pete Buttigieg to change the composition of the Supreme Court constitutional?

Count All Possible Unique Combinations of Letters in a Word

What's currently blocking the construction of the wall between Mexico and the US?

How does DC work with natural 20?

What is "industrial ethernet"?

How to remove this component from PCB

What does the hyphen "-" mean in "tar xzf -"?

Are birchat hoda'ah on the idea or the thing?

Greeting with "Ho"

How do I professionally let my manager know I'll quit over smoking in the office?

Why is it recommended to mix yogurt starter with a small amount of milk before adding to the entire batch?

Why does the Saturn V have standalone inter-stage rings?

What was the Shuttle Carrier Aircraft escape tunnel?

Are springs compressed by energy, or by momentum?

Trainee keeps missing deadlines for independent learning

How can I politely work my way around not liking coffee or beer when it comes to professional networking?

If I wouldn't want to read the story, is writing it still a good idea?



Mysql has gone away error randomly


Fixing “MySQL server has gone away” errorpython mysqldb - mysql server gone away - can't reconnectIntermintent slow MySQL ConnectionsMySQL not accepting connections from WPMySQL lowering wait_timeout value to lower number of open connectionsError 2006: MySQL server has gone away'PDO Connection Error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'2006: MySQL server has gone awayMySql Clients connection timeout randomlyHow to fix mysql has gone away, high writeiops, switch to postgres?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I have a web application written in php. In this app, I have a script(CLI) which is really heavy. After this script finishes its job, I get "mysql has gone away" error in my normal http request for a few minutes. For example, Last time my script finished its job around 22:38 and I was getting "mysql has gone away" for next 3 minutes.



This is the connections to mysql server(Mysql data):



Mysql Connections



And connections to mysql(using something like netstat):



Mysql connections



P.S: most of http request manage to open connection to mysql without any problems.



P.S: After a few minutes, I stop getting this error(22:42 in the chart).
P.S: I get this error when opening a connection using php's PDO or when I want to execute a statement.



P.S: CPU usage is quite normal



enter image description hereenter image description hereenter image description here










share|improve this question
























  • Did you check the manual? dev.mysql.com/doc/refman/8.0/en/gone-away.html

    – Lucas Ramage
    Jun 5 at 15:00











  • @LucasRamage Yes I have

    – undone
    Jun 5 at 17:39











  • You need to provide relevant information, then. Just saying you read the manual is not sufficient.

    – Michael Hampton
    Jun 5 at 17:47











  • This can happen if a query choke your mysql (cpu or the disk). Please include a CPU chart & IO latency chart for the server, it might answer your question.

    – yagmoth555
    Jun 5 at 17:50







  • 1





    @yagmoth555 I added those charts.

    – undone
    Jun 6 at 8:38

















1















I have a web application written in php. In this app, I have a script(CLI) which is really heavy. After this script finishes its job, I get "mysql has gone away" error in my normal http request for a few minutes. For example, Last time my script finished its job around 22:38 and I was getting "mysql has gone away" for next 3 minutes.



This is the connections to mysql server(Mysql data):



Mysql Connections



And connections to mysql(using something like netstat):



Mysql connections



P.S: most of http request manage to open connection to mysql without any problems.



P.S: After a few minutes, I stop getting this error(22:42 in the chart).
P.S: I get this error when opening a connection using php's PDO or when I want to execute a statement.



P.S: CPU usage is quite normal



enter image description hereenter image description hereenter image description here










share|improve this question
























  • Did you check the manual? dev.mysql.com/doc/refman/8.0/en/gone-away.html

    – Lucas Ramage
    Jun 5 at 15:00











  • @LucasRamage Yes I have

    – undone
    Jun 5 at 17:39











  • You need to provide relevant information, then. Just saying you read the manual is not sufficient.

    – Michael Hampton
    Jun 5 at 17:47











  • This can happen if a query choke your mysql (cpu or the disk). Please include a CPU chart & IO latency chart for the server, it might answer your question.

    – yagmoth555
    Jun 5 at 17:50







  • 1





    @yagmoth555 I added those charts.

    – undone
    Jun 6 at 8:38













1












1








1








I have a web application written in php. In this app, I have a script(CLI) which is really heavy. After this script finishes its job, I get "mysql has gone away" error in my normal http request for a few minutes. For example, Last time my script finished its job around 22:38 and I was getting "mysql has gone away" for next 3 minutes.



This is the connections to mysql server(Mysql data):



Mysql Connections



And connections to mysql(using something like netstat):



Mysql connections



P.S: most of http request manage to open connection to mysql without any problems.



P.S: After a few minutes, I stop getting this error(22:42 in the chart).
P.S: I get this error when opening a connection using php's PDO or when I want to execute a statement.



P.S: CPU usage is quite normal



enter image description hereenter image description hereenter image description here










share|improve this question
















I have a web application written in php. In this app, I have a script(CLI) which is really heavy. After this script finishes its job, I get "mysql has gone away" error in my normal http request for a few minutes. For example, Last time my script finished its job around 22:38 and I was getting "mysql has gone away" for next 3 minutes.



This is the connections to mysql server(Mysql data):



Mysql Connections



And connections to mysql(using something like netstat):



Mysql connections



P.S: most of http request manage to open connection to mysql without any problems.



P.S: After a few minutes, I stop getting this error(22:42 in the chart).
P.S: I get this error when opening a connection using php's PDO or when I want to execute a statement.



P.S: CPU usage is quite normal



enter image description hereenter image description hereenter image description here







mysql php tcp connection pdo






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 6 at 8:38







undone

















asked Jun 5 at 14:27









undoneundone

142117




142117












  • Did you check the manual? dev.mysql.com/doc/refman/8.0/en/gone-away.html

    – Lucas Ramage
    Jun 5 at 15:00











  • @LucasRamage Yes I have

    – undone
    Jun 5 at 17:39











  • You need to provide relevant information, then. Just saying you read the manual is not sufficient.

    – Michael Hampton
    Jun 5 at 17:47











  • This can happen if a query choke your mysql (cpu or the disk). Please include a CPU chart & IO latency chart for the server, it might answer your question.

    – yagmoth555
    Jun 5 at 17:50







  • 1





    @yagmoth555 I added those charts.

    – undone
    Jun 6 at 8:38

















  • Did you check the manual? dev.mysql.com/doc/refman/8.0/en/gone-away.html

    – Lucas Ramage
    Jun 5 at 15:00











  • @LucasRamage Yes I have

    – undone
    Jun 5 at 17:39











  • You need to provide relevant information, then. Just saying you read the manual is not sufficient.

    – Michael Hampton
    Jun 5 at 17:47











  • This can happen if a query choke your mysql (cpu or the disk). Please include a CPU chart & IO latency chart for the server, it might answer your question.

    – yagmoth555
    Jun 5 at 17:50







  • 1





    @yagmoth555 I added those charts.

    – undone
    Jun 6 at 8:38
















Did you check the manual? dev.mysql.com/doc/refman/8.0/en/gone-away.html

– Lucas Ramage
Jun 5 at 15:00





Did you check the manual? dev.mysql.com/doc/refman/8.0/en/gone-away.html

– Lucas Ramage
Jun 5 at 15:00













@LucasRamage Yes I have

– undone
Jun 5 at 17:39





@LucasRamage Yes I have

– undone
Jun 5 at 17:39













You need to provide relevant information, then. Just saying you read the manual is not sufficient.

– Michael Hampton
Jun 5 at 17:47





You need to provide relevant information, then. Just saying you read the manual is not sufficient.

– Michael Hampton
Jun 5 at 17:47













This can happen if a query choke your mysql (cpu or the disk). Please include a CPU chart & IO latency chart for the server, it might answer your question.

– yagmoth555
Jun 5 at 17:50






This can happen if a query choke your mysql (cpu or the disk). Please include a CPU chart & IO latency chart for the server, it might answer your question.

– yagmoth555
Jun 5 at 17:50





1




1





@yagmoth555 I added those charts.

– undone
Jun 6 at 8:38





@yagmoth555 I added those charts.

– undone
Jun 6 at 8:38










0






active

oldest

votes














Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f970239%2fmysql-has-gone-away-error-randomly%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f970239%2fmysql-has-gone-away-error-randomly%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

Why did Thanos need his ship to help him in the battle scene?Which actor plays Thanos in the Avengers mid-credits scene?Are there economic implications portrayed in comics where the buildings and cities are ruined almost daily?Old X-Men comic where team travels to alien world with a ring-like sun that needs recharging?Why does Ego need help sleeping?Is there an objective answer to who “the strongest Avenger” is?How did Banner get unstuck?Why did Thanos get hit?How did Thanos (or anyone) know the Infinity Stones would give him this power?Did Thanos leave Eitri alive for his after-sales service?In Avengers 1, why does Thanos need Loki?