Re: Lost connection, C API
Chambon writes: Hello, No there's no thread in my application, the program use fork but of course a new connection is create after each fork() Today before running another test I do the following - drop then create the tables - increase the limit for opened file from 1024 to 4096 I run a test for 2 hours and I got : - Lost connection to MySQL (708) - Can't connect to MySQL server (49) //error while trying new connection 49 errors in 6 seconds in from 14:07:16 to 14:07:22 (due to a burst of fork() ) - 'ip_adress' is not allowed to connect to this MySQL Server (4) //error while trying new connection - Commands out of sync (6) But apart of these errors I have made many successful insert (4457) , update (11594), select (25017) that why I am confused and I don't know what to change ! Best regards -- Bernard CHAMBON IN2P3 / CNRS (Centre de Calcul de LYON) email: mailto:[EMAIL PROTECTED] Tel : 04 72 69 42 18 Hi! This seems like a typical programming error in multi-tasking ... You must enclose mysql_query/mysql_use/fetch_row commands so that no two processes can go through it in the same time with the same MYSQL and MYSQL_RES handles. -- Regards, __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Lost connection, C API
Heikki Tuuri wrote: Hi! Are you running mysqld under the safe_mysqld script, which automatically restarts mysqld after a crash? Yes, mysqld started with safe_mysqld script If yes, look at the 'hostname'.err file and send its contents to me. Nothing happens in the hostname.err (I started mysqld this morning at 11:45) 020107 11:45:08 mysqld started 020107 11:45:08 Warning: setrlimit couldn't increase number of open files to more than 1024 020107 11:45:08 Warning: Changed limits: max_connections: 512 table_cache: 251 020107 11:45:10 InnoDB: Started /opt/mysql/libexec/mysqld: ready for connections With ps ..., I confirm that mysqld processes have NOT restarted (running since 11:45) Or, if you run mysqld from the command prompt, capture what mysqld prints to the command prompt window. If mysqld does not crash, then the problem is probably some client/server issue. Regards, Heikki Has we got a network error yesterday, I have run another test this night with the following modifications : max_connect_errors=65535 skip-host-cache connection to 'localhost' (the client and the serveur run on the same machine) I have got errors like : MySQL server has gone away (12 occurences) Commands out of sync; You can't run this command now (85 occurences) Lost connection to MySQL server during query (only one occurence) The transaction overload is about : 200848 Insert 486205 Update 334945 Select for 8 hours Before restarting the 2nd test I restart mysqld (yesterday at 22:28) so here is the hotname.err --- 020107 11:45:08 mysqld started 020107 11:45:08 Warning: setrlimit couldn't increase number of open files to more than 1024 020107 11:45:08 Warning: Changed limits: max_connections: 512 table_cache: 251 020107 11:45:10 InnoDB: Started /opt/mysql/libexec/mysqld: ready for connections 020107 22:27:45 /opt/mysql/libexec/mysqld: Normal shutdown 020107 22:27:45 InnoDB: Starting shutdown... 020107 22:27:58 InnoDB: Shutdown completed 020107 22:27:58 /opt/mysql/libexec/mysqld: Shutdown Complete 020107 22:27:58 mysqld ended 020107 22:28:25 mysqld started 020107 22:28:26 Warning: setrlimit couldn't increase number of open files to more than 1024 020107 22:28:26 Warning: Changed limits: max_connections: 512 table_cache: 251 020107 22:28:27 InnoDB: Started /opt/mysql/libexec/mysqld: ready for connections Status information: Current dir: /opt/mysql/var/ Current locks: lock: 83f3ed0: lock: 8396308: lock: 8395a28: lock: 838cfa0: lock: 8390c00: lock: 838cf00: lock: 838ce60: lock: 838c588: lock: 837e8b8: lock: 837ee28: lock: 837ed90: lock: 83746e0: key_cache status: blocks used: 0 not flushed: 0 w_requests: 0 writes: 0 r_requests: 0 reads: 0 handler status: read_key: 5704 read_next:1706 read_rnd47 read_first:394 write:1447 delete 0 update:465 Table status: Opened tables: 26 Open tables: 20 Open files: 2 Open streams: 0 -- Bernard CHAMBON IN2P3 / CNRS (Centre de Calcul de LYON) Tél : 04 72 69 42 18 http://www.in2p3.fr/CC - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Lost connection, C API
Bernard Chambon wrote: 020107 11:45:08 Warning: setrlimit couldn't increase number of open files to more than 1024 Bernard: How come you're not giving your OS more file descriptors? ulimit problem, perhaps. Van database,sql,query,table -- = Linux rocks!!! http://www.dedserius.com/ = - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Lost connection, C API
Hi! Then it looks like a problem in the communication or in your client test program. The following error Commands out of sync; You can't run this command now (85 occurences) means that you have issued C API commands to a single MySQL connection in a wrong order. If your application has several client threads, are you sure you create one connection to each thread, and issue the C API commands in the right order? Sometimes people try to use a single connection for several client threads, and get the error above. Best regards, Heikki Tuuri Innobase Oy --- Order technical MySQL/InnoDB support at https://order.mysql.com/ See http://www.innodb.com for the online manual and latest news on InnoDB -Original Message- From: Bernard Chambon [EMAIL PROTECTED] To: Heikki Tuuri [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Tuesday, January 08, 2002 11:16 AM Subject: Re: Lost connection, C API Heikki Tuuri wrote: Hi! Are you running mysqld under the safe_mysqld script, which automatically restarts mysqld after a crash? Yes, mysqld started with safe_mysqld script If yes, look at the 'hostname'.err file and send its contents to me. Nothing happens in the hostname.err (I started mysqld this morning at 11:45) 020107 11:45:08 mysqld started 020107 11:45:08 Warning: setrlimit couldn't increase number of open files to more than 1024 020107 11:45:08 Warning: Changed limits: max_connections: 512 table_cache: 251 020107 11:45:10 InnoDB: Started /opt/mysql/libexec/mysqld: ready for connections With ps ..., I confirm that mysqld processes have NOT restarted (running since 11:45) Or, if you run mysqld from the command prompt, capture what mysqld prints to the command prompt window. If mysqld does not crash, then the problem is probably some client/server issue. Regards, Heikki Has we got a network error yesterday, I have run another test this night with the following modifications : max_connect_errors=65535 skip-host-cache connection to 'localhost' (the client and the serveur run on the same machine) I have got errors like : MySQL server has gone away (12 occurences) Commands out of sync; You can't run this command now (85 occurences) Lost connection to MySQL server during query (only one occurence) The transaction overload is about : 200848 Insert 486205 Update 334945 Select for 8 hours Before restarting the 2nd test I restart mysqld (yesterday at 22:28) so here is the hotname.err --- 020107 11:45:08 mysqld started 020107 11:45:08 Warning: setrlimit couldn't increase number of open files to more than 1024 020107 11:45:08 Warning: Changed limits: max_connections: 512 table_cache: 251 020107 11:45:10 InnoDB: Started /opt/mysql/libexec/mysqld: ready for connections 020107 22:27:45 /opt/mysql/libexec/mysqld: Normal shutdown 020107 22:27:45 InnoDB: Starting shutdown... 020107 22:27:58 InnoDB: Shutdown completed 020107 22:27:58 /opt/mysql/libexec/mysqld: Shutdown Complete 020107 22:27:58 mysqld ended 020107 22:28:25 mysqld started 020107 22:28:26 Warning: setrlimit couldn't increase number of open files to more than 1024 020107 22:28:26 Warning: Changed limits: max_connections: 512 table_cache: 251 020107 22:28:27 InnoDB: Started /opt/mysql/libexec/mysqld: ready for connections Status information: Current dir: /opt/mysql/var/ Current locks: lock: 83f3ed0: lock: 8396308: lock: 8395a28: lock: 838cfa0: lock: 8390c00: lock: 838cf00: lock: 838ce60: lock: 838c588: lock: 837e8b8: lock: 837ee28: lock: 837ed90: lock: 83746e0: key_cache status: blocks used: 0 not flushed: 0 w_requests: 0 writes: 0 r_requests: 0 reads: 0 handler status: read_key: 5704 read_next:1706 read_rnd47 read_first:394 write:1447 delete 0 update:465 Table status: Opened tables: 26 Open tables: 20 Open files: 2 Open streams: 0 -- Bernard CHAMBON IN2P3 / CNRS (Centre de Calcul de LYON) Tél : 04 72 69 42 18 http://www.in2p3.fr/CC - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Lost connection, C API
Hello, No there's no thread in my application, the program use fork but of course a new connection is create after each fork() Today before running another test I do the following - drop then create the tables - increase the limit for opened file from 1024 to 4096 I run a test for 2 hours and I got : - Lost connection to MySQL (708) - Can't connect to MySQL server (49) //error while trying new connection 49 errors in 6 seconds in from 14:07:16 to 14:07:22 (due to a burst of fork() ) - 'ip_adress' is not allowed to connect to this MySQL Server (4) //error while trying new connection - Commands out of sync (6) But apart of these errors I have made many successful insert (4457) , update (11594), select (25017) that why I am confused and I don't know what to change ! Best regards Heikki Tuuri wrote: Hi! Then it looks like a problem in the communication or in your client test program. The following error Commands out of sync; You can't run this command now (85 occurences) means that you have issued C API commands to a single MySQL connection in a wrong order. If your application has several client threads, are you sure you create one connection to each thread, and issue the C API commands in the right order? Sometimes people try to use a single connection for several client threads, and get the error above. Best regards, Heikki Tuuri Innobase Oy -- Bernard CHAMBON IN2P3 / CNRS (Centre de Calcul de LYON) email: mailto:[EMAIL PROTECTED] Tel : 04 72 69 42 18 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Lost connection, C API
Hi! Are you running mysqld under the safe_mysqld script, which automatically restarts mysqld after a crash? If yes, look at the 'hostname'.err file and send its contents to me. Or, if you run mysqld from the command prompt, capture what mysqld prints to the command prompt window. If mysqld does not crash, then the problem is probably some client/server issue. Regards, Heikki ... Hello I am using MySql 3.23.47 on Linux (2.2.17-14smp) and InnoDB I do Intensive test (=Insert + Update + Select) using C API and running the processes on the same machine. Every thing work fine, BUT, some time to time I got some Lost connection to MySQL ... (errno = 2013) The query concerned is a small select (only 1 field) on a small table (6 fields) (the max_allowed_packet is set to 16M ) Has anybody encountred a similar problem ? Is there a relation with the net_read_timeout (set to 30) Thank you -- Bernard CHAMBON IN2P3 / CNRS (Centre de Calcul de LYON) Tél : 04 72 69 42 18 http://www.in2p3.fr/CC - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php