List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:July 30 1999 6:02pm
Subject:MySQL starts 'Lost connection during query' when connecting after too many threads??
View as plain text  
>>>>> "Rob" == Rob Bedell <zen@stripped> writes:

Rob> Sorry for the poor subject line.
Rob> I am running MySQL configured for a high number of concurrent users.  These
Rob> are spawned by a highly accessed webserver and perform most simple queries
Rob> on a small table.  Occassionally other tables are accessed with complicated
Rob> queries.  One table, gathering statistics, has many updates/inserts
Rob> performed on it once per hour, on the order of a few thousand.

Rob> Most of the time MySQL runs fine with 100-200 threads all being accessed
Rob> occassionally with simple selects.  Every so often (the interval varies,
Rob> sometimes it's several days, other times every two hours), MySQL basically
Rob> bombs out, allowing connections but then immediately disconnecting them
Rob> yielding an error of 'Lost connection during query'.  As far as I can
Rob> tell these errors do not correspond with the statistical updates I'm
Rob> doing.  (Would locking the table rule out problems with complicated SELECTs
Rob> while doing that many INSERTs?).  Also, even though I have the server
Rob> configured (per-thread memory usage parameters included) for a high number
Rob> of connections (1500 max, 3000 table_cache, etc, OS parameters tuned as
Rob> best as possible for this as well).  Access spikes send threads up
Rob> to 300 or so.

<cut>

Hi!

Normally you should NEVER get 'Lost connection during query'.  This
can only happen if:

- You issued a question that was longer than 'max_packet_length'
- The mysqld server restarted
- If you used persistent connections and the connection had timed out
  and somehow the automatic connection failed.
- Someone killed the thread with 'mysqladmin kill' or 'kill threadid'

If you can find out why you get 'Lost connection' then we can probably 
help you find out what's wrong.

Do you have any messges in the 'hostname.err' file?

You should also consider building MySQL with full optimization;  This
can give make your server 10-20 % faster and a bit safer!  Check the MySQL 
manual for the recommended configure options!

Regards,
Monty


Thread
MySQL starts 'Lost connection during query' when connecting after too many threads??Rob Bedell16 Jul
  • MySQL starts 'Lost connection during query' when connecting after too many threads??sinisa16 Jul
  • MySQL starts 'Lost connection during query' when connecting after too many threads??Michael Widenius30 Jul