in reply to Re^2: DBD::MySQL timeout during query
in thread DBD::MySQL timeout during query

Here is the MySQL developers section on this http://dev.mysql.com/doc/mysql/en/Gone_away.html

Anyway the query will take a long time as it needs a full table scan*. You must have a slow server/disks as it takes me 1.67 seconds to run a similar query on a million row data set. As noted by astroboy forking can cause this issue, but I suspect it is something to do with your MySQL configuration. Here is what we use with 2GB of RAM. It might be worth a try. The extended timeouts discussed before are not included (never needed them) but should be. There is some suggestion the connect timeout you can set here may be important.

[mysqld] datadir=/var/lib/mysql socket=/tmp/mysql.sock set-variable=wait_timeout=200000 set-variable=key_buffer=256M set-variable=max_allowed_packet=32M set-variable=table_cache=512 set-variable=sort_buffer_size=64M set-variable=record_buffer=64M set-variable=read_buffer_size=32M set-variable=myisam_sort_buffer_size=64M set-variable=thread_cache=8 set-variable=query_cache_size=32M set-variable=tmp_table_size=32M set-variable=max_connections=900

As you are on Win32 it is possible that it is a quirk related to the Win32 ports of Perl/DBI/DBD::mysql/MySQL. If you have a Linux box with MySQL it would be interesting to see if the problem is repeatable on the more native platform.

cheers

tachyon

Replies are listed 'Best First'.
Re^4: DBD::MySQL timeout during query
by rcraig (Initiate) on Sep 10, 2004 at 15:57 UTC
    Thanks tachyon - the new settings have fixed the problem. I'm not sure which one, I haven't played with the new settings, but I think it may have been the query_cache_size, as all queries that are run more than once run faster, also from the mysql prompt.
    Still the issue remains for a query that will take longer than the prescribed 30 seconds, but whatever.
    Thanks again for helping.
    RC