concurrency in mysql 4.0.25

2005-11-12 Thread Chris Kantarjiev
I'm running mysql 4.0.25 on netbsd 3, on a dual-processor opteron machine with 
16GB. I'm trying to make things faster, of course. All the data operations are 
on one very large table (about 20GB, index is 17GB), which I will eventually 
figure out how to split.


I have four processes working on this table at once; they select 20,000 or more 
row, chew for a while, and then update those rows. I have a lot of trouble with 
the index blocks getting flushed when updates are done in parallel, so there is 
some judicious locking to help that. (The key_buffer_size is set to 4GB, which 
is the maximum supported - I'd use more if I could.)


What I notice is that even though I have two client threads doing SELECT at the 
same time, I never manage to use more than one CPU, maybe dipping into the 
second one a small bit. The mysql config log indicates that it found pthreads 
and compiled with it. systat vmstat tells me that the disks are idle, memory is 
full, and top indicates that the mysqld process is CPU bound. There are many 
many syscalls being completed; I'm guessing that the blocks are moving from file 
buffer pages to the process.


Is there a tool (or option to ps or top) that lets me view the thread activity 
inside a process?


I see in the pthread(3) man page that there's an environment variable

  PTHREAD_CONCURRENCY  The number of concurrent threads to be run.
  This value should at least be 1, and smaller
  than or equal to the number of CPUs.

Do I need to set this to be more than 1 in the mysqld environment?

Thanks,
chris


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: concurrency in mysql 4.0.25

2005-11-12 Thread Chris Kantarjiev



I see in the pthread(3) man page that there's an environment variable

  PTHREAD_CONCURRENCY  The number of concurrent threads to be run.
  This value should at least be 1, and smaller
  than or equal to the number of CPUs.

Do I need to set this to be more than 1 in the mysqld environment?


Apparently the answer to this is 'yes', based on a brief experiment I just did. 
Very nice.


I'd still like some tool that lets me see the threads inside a process...

chris


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]