Very often I used to find that my Linux box(s), Fedora & Ubuntu both started reserving more RAM over a period of time since its boot. And the actual RAM left free was less.
I knew it was holding some caches for itself so that it could find the programs loading “quickly” and something like that (Sorry for my newbie language).
The most common way to free up RAM is Rebooting! But I wanted to avoid it, so did a little “googling” and I came up with an interesting solution – Tell linux to flush all the caches.
# Flush file system buffers by executing
sync;
# free page cache
echo 1 > /proc/sys/vm/drop_caches;
# free dentries and inodes
echo 2 > /proc/sys/vm/drop_caches
# free page cache, dentries and inodes
echo 3 > /proc/sys/vm/drop_caches
I’ve created a simple bash script, which u can download.
Just yesterday had an update on Fedora 11 for KDE 4.4. I expected from KDE 4.x legacy that the overall product would be a bit tacky. But opposed to my original thoughts it turned out to be an extremely well polished ‘Desktop’.
The settings were very easy to navigate, with lots of Compiz settings available easily without a lot of ‘extra’ installations as in GNOME. The overall stability of the desktop too was strong. I’m considering to run KDE 4.4 for atleast a week as suggested by one of my sysadmin friends.
This edition reminds me of the good old stable days of KDE 3.x
Each thread made 10,000 open-close connections to the server
The server was
Intel(R) Pentium(R) D CPU 3.00GHz
Fedora 10 32bit
Intel(R) Pentium(R) D CPU 3.00GHz
2.6.27.38-170.2.113.fc10.i686 #1 SMP
1GB RAM
Used a md5 as key and a value that was saved
Created an index on the key column of the table
Each server had SET and GET requests as a different test at same concurrency
Results please !
I wanted to simulate a situation where I had 2 servers (clients) serving my code, which connected to the 1 server (memcached, redis, or whatever). Another thing to note was that I used Python as the client in all the tests, definately the tests would give a different output had I used PHP. Again the test was done to check how well the clients could make and break the connections to the server, and I wanted the overall throughput after making and breaking the connections. I did not monitor the response times. I didnt change absolutely any parameters for the servers, eg didn’t change the innodb_buffer_pool_size or key_buffer_size.
MySQL
MySQL lacked the whole scene terribly, I monitored the MySQL server via the MySQL Administrator and found that hardly there were any conncurrent inserts or selects, I could see the unauthenticated users, which meant that the client had connected to MySQL and was doing a handshake using MySQL authentication (using username and password). As you could see I didn’t even perform the 40 and 60 thread tests.
I truncated the table before I swtiched my tests from MyISAM to InnoDB. And always started the tests from lesser threads. My table was as follows
For Tokyo Tyrant I used a file.tch as the DB, which is a hash database. I also tried MongoDB as u may find if u have opened the worksheet, But the server kept failing or actually the mongod failed after coming at an unhandled Exception. I found something similar over here. I tried 1.0.1, 1.1.3 and the available Nightly build, but all failed and I lost my patience.
Now what
If you need speed just to fetch a data for a given combination or key, Redis is a solution that you need to look at. MySQL can no way compare to Redis and Memcache. If you find Memcache good enough, you may want to look at Tokyo Tyrant as it does a synchronous writes. But you need to check for your application which server/combination suits you the best. In Marathi there is a saying “मेल्या शिवाय स्वर्ग दिसत नाही”, which means “You can’t see heaven without dieing” or need to do your hard work, can’t escape that 😉
I’ve attached the source code used to test, if anybody has any doubts, questions feel free to ask
Guys using Fedora 10, must’ve seen this problem of Pulseaudio taking high CPU usage. After a lot of tweaking, I came to this. From System -> Preferences -> Hardware -> Sound
Change all the drop downs to ALSA. Just make sure u “Test” and hear the tone before applying the changes.
Update
I’ve done this yum remove pulseaudio. This removes the root cause 🙂
Configuring Wifi on Dell 1525 with Fedora 10 wasn’t much a problem. I enabled the RPM Fusion Free and Non Free repositories. And used the following command.
India too can take a cue from Russia, who is working with Fedora guys to develop an official Russian OS. India too could save millions by by-passing the Windows licenses.