1 |
On 7/21/2011 5:14 PM, Grant wrote: |
2 |
>>>> Any reason you're still using MyISAM tables? Innodb is almost as |
3 |
>>>> fast |
4 |
>>>> or much much faster than MyISAM in nearly every way these days. |
5 |
>>> |
6 |
>>> Can multiple processes be utilized for mysql like they are for |
7 |
>>> apache2? Perhaps not since it's a database? |
8 |
>> |
9 |
>> Mysql is multithreaded and spawns a thread for each connection. Try a |
10 |
>> ps -efL and you should see a number of Mysql threads. However that is part |
11 |
>> of the problem with MyISAM. It throws a giant table lock blocking all other |
12 |
>> threads until the SQL statement is complete. Innodb uses row locks which |
13 |
>> allows the other threads to use the table. |
14 |
>> |
15 |
>> As far as moving to Innodb tables it's actually easy, but with a |
16 |
>> number of caveats. I'd lower your Apache max clients, tweak my.cnf, and runs |
17 |
>> some load tests before getting deep into Mysql. When you're ready I'd go |
18 |
>> about this way. |
19 |
> |
20 |
> apache MaxClients has been lowered to 50 which is a shame because I |
21 |
> have 30+ separate images on each of my pages and that number can not |
22 |
> be reduced. This means I may not be able to serve more than 1 full |
23 |
> page at a time. |
24 |
|
25 |
This is wrong. |
26 |
|
27 |
>> 1. Make backups first. |
28 |
>> 2. See if you have any full text fields. Tables with full text fields will |
29 |
>> have to remain MyISAM. |
30 |
> |
31 |
> Many of my tables have one or more fields defined as TEXT out of |
32 |
> laziness. Should I instead come up with an appropriate char(N) |
33 |
> declaration for each? Can N go as high as necessary? |
34 |
|
35 |
TEXT fields don't matter, FULL TEXT indexes do. Sorry my mistake. |
36 |
|
37 |
> OK, just leave key_buffer at the default 16M? |
38 |
|
39 |
No. Make key_buffer 256M and then restart Mysql or update it from the |
40 |
commandline. You're starving Mysql for resources. Fix this first. Then |
41 |
you can mess around with tables and engines. |
42 |
|
43 |
kashani |