On Fri, Apr 24, 2009 at 9:31 AM, Nathanael Cariaga <[email protected]> wrote: > > proxy:~# df -hi > Filesystem Inodes IUsed IFree IUse% Mounted on > /dev/sda1 4.5M 4.5M 42K 100% / > > proxy:~# df -ha > Filesystem Size Used Avail Use% Mounted on > /dev/sda1 71G 24G 44G 36% /
it looks like your squid is consuming all your inodes... most of your files consuming the inodes are small as you have more free space left in your root partition... no free inodes mean no new files to create... thats the reason why you have failed startups of your applications because there are no inodes left as every applications consume already three files (stdin, stdout and stderr) during startup... unfortunately... ext2/ext3/ext4 dont have a feature of dynamic inode allocation... therefore you cant create more inodes on that partition... you have two options for your problem... 1. reinstall your squid server and increase the inodes by lowering the bytes per inode... 2. if you dont want to reinstall/reformat your squid server.. delete your squid's cache objects, adjust or decrease your cache_dir size and rebuild your cache_dir again... but here are some tips for your squid server for maximum performance... 1. always create different partitions... every partition has its own inode list... every partition has its own attributes and can be tune depends on the usage of that partition... example for this is to see the next tip... 2. disable atime (update inode last access time) for squid's partition... unlike with email, news and other servers where access time is important to them.. for squid.. it is not depending or not using atime... therefore you can safely disable this mount option.. this will improve your disk i/o especially on your write i/o as caching is doing a lot of file access on its disk cache... with this , your buffer cache will not polluted for atime updates and write it to disk... 3. it doesnt mean that you have a big disk space.. you can freely allocated all this to squid... every cache object has its own memory allocation.. i havent touch squid for several years... the last time i touched squid was version 2.2.. the memory allocation ratio is that for every 1GB of disk cache.. it consumes 32 MB of ram for that version... so you do the math how much ram is consumed if you have 71GB of disk space for that version... for current version.. your clue can be found at squid's cache manager (cachemgr.cgi)... 4. to know how many inodes you will going to allocate to your squid partition... the average cache object size is around 13kb (you can find that also in cachemgr.cgi).. so your computation is your cache_dir size divided by the average cache object.. this is your minimum number of inodes allocation for your squid partition... 5. if you have multiple disks.. spread the cache_dirs to all those disks to improve disk i/o performance... although you can put all your disks to a raid 0 configuration.. squid performs well spreading your cache_dirs to multiple disks instead of one cache_dir pointing to raid 0 partition... 6. now you already determined how much cache_dir size you are going to allocate based on the ram availability of your server as mentioned on tip number 3.. your actual squid's parition size must be times 2 of your cache_dir size... this is for fragmentation purposes... caching is active for adding new objects and deleting least recently used (LRU objects to your disk.. fragmentation occurs when the size of a cache object to add doesnt fit to a contigously or sequentially blocks of a given free space... thus movement of your disk head is jumping from one block to another block which degraded your disk i/o performance both for writing and rading versus to a continous reads.. if you have another dedicated half of free space allocated to your squid partition.. this will prevent fragmentation to your squid partition.... thus better performance... 7. always remember that outer tracks are much more quickly to transfer data than the inner tracks... so therefore.. move your heavily disk i/o partition towards the outer tracks (eg. squid partition, /var partition) and lower disk i/o (eg. root partition) towards the inner tracks... thats the reason why you need to partition your disk as every partition has its own usage.. these tips are only for disk i/o operations as there is another separate tips for network i/o (eg. tuning tcp/ip stack) and cpu i/o (eg. tuning scheduler time allocation)... fooler. _________________________________________________ Philippine Linux Users' Group (PLUG) Mailing List http://lists.linux.org.ph/mailman/listinfo/plug Searchable Archives: http://archives.free.net.ph

