New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
You have to give us a baseline first. We can't tell you which one to increase because we don't know how much each one currently has.
It have to be analysed per instanse. At least post your stats, memory usage, number of visitors etc.
If you have a site with lots of mysql queries, then
If you have a lot of static objects,
Else if you have some calculations,
Always yours, C.O.
Monitor MySQL stats, there's more than just general buffer/cache you need to worry about, things like table_cache and max_connections.
Workers should typically stay equal to # of CPUs, just increase the max # of connections per worker process, nginx is pretty efficient.
It doesn't hurt to increase the max # of php-fpm processes, the main php-fpm process will spawn new ones when needed, and despawn them when they're not needed. Assuming you use the dynamic pm, which you should.
You might want to run mysqltuner.pl (that's the URL, too) and see what it recommends.
If you're running on Xen or KVM then 'free' memory will be used for disk caching, so no need to worry about it
But definitely run mysqltuner.pl as raindog308 suggests to ensure you've allocated enough, and not too much, memory for mysql.
Thank you all for the reply and tips, at the moment I don't have something substantial to show yet, just one two sites up for the learning purpose.
Run the script (thanks raindog308) I think I know one or two things required adjustment. Another Q please
What are those two mean?
@breton: Thanks for your general guidelines.
Run an optimize table query in all your tables :P
If you have phpmyadmin is easier :P
For fragmented tables, you can run
OPTIMIZE TABLE [table name];
in MySQL to "defrag" the disk usage of those tables to remove the fragmentation.For temp tables created on disk -- it's much more complicated. There are a lot of reasons why MySQL would create temp tables on disk (rather than in memory). Basically the temp result set is too big. For some queries you can just increase the
tmp_table_size
, but in some cases you need to rewrite the queries.IIRC queries that include TEXT or other BLOB columns will usually result disk-temp table creation. Those are a lot harder to remove. For one of my heavier sites, I basically just mount a path to be
tmpfs
and then changetmpdir
to it inmy.cnf
, so temp tables are most often created in memory.How much space do you have in that tmpfs disk?
I have 1GB for my 4GB Xen VPS. However it is rarely use more than 1%...
So, maybe using... 100MB should be ok I guess
Sometimes its good to keep somethings free.