Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

close the table after search?

Quote Reply
close the table after search?
hi,

I'm new to mysql, just wanna check out is there any where in search.cgi have close the tables when the search is done.

I am asking this is because my system admin told me that when the mysql open tables show up there is 700++ tables open, but the server have only 100++ requests being processed. Is this mean the search.cgi doesn't close the tables/connection properly?

please forgive my broken english, hope that you can understand my english. Smile

Thanks in advance!

Best regards,
Tan
Quote Reply
Re: close the table after search? In reply to
now i got an error below, is this scripts problem or mysql problem?:

Software error:
DBSQL (31864): Fatal Error: Unable to connect to the SQL server. Reason: Too many connections at /home/httpd/catcha.com.my/cgi-bin/l/jump.cgi line 65
Quote Reply
Re: close the table after search? In reply to
Having more tables open then you have tables is normal. See:

http://www.mysql.com/...nce.html#Open_tables

for more info. Are you running under mod_perl, fastcgi or some other environment like that? Links SQL only uses DBSQL.pm to make connections to the database, and it always closes the connection to the database when the script is finished.

Cheers,

Alex
Quote Reply
Re: close the table after search? In reply to
Whoah!!

I'm beating my MySQL to death with several databases and hundreds of tables, but I'm no where near those stats!

I have 67 open (107 open files) but 16,000 openED files.


You might want to check the MySQL site for some data on the system, but that sounds awefully high.

MySQL is in charge of opening/closing the tables, and it keeps a lot of stuff open for speed. Everything you do is just a database query, and MySQL determines how to handle it.




------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/








Quote Reply
Re: close the table after search? In reply to
it was 1380 right now, and keep increasing every second. Frown

here is the status:

Uptime: 13357 Threads: 1394 Questions: 56411 Slow queries: 2755 Opens: 28685 Flush tables: 1 Open tables: 1380
Quote Reply
Re: close the table after search? In reply to
Are you the only one using the MySQL engine on your server?

The relevante portion of the MySQL docs is:
Quote:
MySQL is multithreaded, so it may have many queries on the same table simultaneously. To minimize the problem with two threads having different states on the same file, the table is opened independently by each concurrent thread. This takes some memory and one extra file descriptor for the data file. The index file descriptor is shared between all threads.

Which I didn't mean to imply wasn't (if I did). The more active your system is, the more open tables you'll have. BUT -- MySQL is in charge of this.

Links, and any well behaved DBI: Smile

For information purposes...

Check your MySQL stats at your lowest level of traffic time -- see what the threads and tables stats are.

Also, see if you shut your server down for 5 minutes if that changes the stats. (Some persistants are probably 10 minutes... but most should be under 5 minutes).

I keep close tabs on my server stats, and I've not see these sort of numbers. I'm curious. Smile







[This message has been edited by pugdog (edited January 05, 2000).]