Category: Admin-tips
How to unmount NFS share mounted with hard option
29 Aug2007

Few days ago I worked on some customer’s server and there was a problem – their nfs server went down and we were forced to change some settings on their FC4 clients to prevent shares from dieing because of kernel bug. But when we’ve changed settings in /etc/fstab there was one more step before task was completed – we need to remount this share (I mean unmount/mount). But how to perform this operation if there are some processes in D (non-interruptible sleep) waiting for dead share and prevent it from unmounting? They wait because of hard option on the share and lack of intr option and any unmount request would produce a following results:

1
2
3
streaming01:~# umount /storages/2
umount: /storages/2: device is busy
umount: /storages/2: device is busy

So, here is a list of steps you need to do to be able to remount your share.

First of all, you need to send KILL(9) signal to all you processes waiting for share. I’ve used ps axu and filtered all processes in D state. When all processes ‘killed’ (they can’t be killed actually), you’ll need to send the same signal to rpciod processes in your system. After this all your sleeping processes will die and you’ll be able to unmount your share.

That’s it – simple and really useful tip for people using NFS in their systems.


Using Nginx, SSI and Memcache to Make Your Web Applications Faster
5 Aug2007

If you’d take a look at any web site, you will notice, that almost all of the pages on this given site are pretty static in their nature. Or course, this site could have some dynamic elements like login field or link in the header, some customized menu elements and some other things… But entire page could be considered static in many cases.

When I started thinking about my sites from this point of view, I understood, how great it would be to be able to cache entire page somewhere (in memcache for example) and be able to send it to the user without any requests to my applications, which are pretty slow (comparing to memcache 😉 ) in content generation. Then I came up with a pretty simple and really powerful idea I’ll describe in this article. An idea of caching entire pages of the site and using my application only to generate small partials of the page. This idea allows me to handle hundreds of queries with one server running pretty slow (yeah! it is slow even after all optimizations on MySQL side and lots of tweaks in site’s code) Ruby on Rails application. Of course, the idea is kind of universal and could be used with any back-end languages, technologies or frameworks because all of them are slower then memcache in content “generation”.

Read the rest of this entry


Small Tip: How to fix “There are no public key available for the following key IDs” Error in Debian
28 Nov2006

Few days ago I’ve started migration of some of my non-critical servers to Debian Etch (from Sarge). Just after first apt-get update && apt-get dist-upgrade, when apt has been upgraded, I noticed really strange (as for me) error: when I’ve tried to do “apt-get update” it worked fine, but there was annoying message like following:

1
2
3
4
5
6
7
8
# apt-get update
......
Fetched 5562B in 13s (421B/s)
Reading package lists... Done
W: There are no public key available for the following key IDs:
A70DAF536070D3A1
W: You may want to run apt-get update to correct these problems
#


UPDATE: Thanks to Kurt Fitzner we know, that:

There is already a mechanism to do this automatically:

1
$ apt-key update

This will obtain the necesary keys and import them. No need to go through gpg directly.


After not so long research I figured out, that this problem was caused by change of gpg key used by ftpmaster on Debian official repository servers. Google gave me some information and I found some fix which works fine for me:

1
2
3
4
5
6
# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys XXXXXXXXXXXXXXXX
...
# apt-key add /root/.gnupg/pubring.gpg
...
# apt-get update
...

Where XXXXXXXXXXXXXXXX is your missing key (e.g A70DAF536070D3A1).

That’s it! Happy using Debian GNU/Linux!


[lang_en]High-Performance Ruby On Rails Setups Test: mongrel vs lighttpd vs nginx[/lang_en][lang_ru]Варианты настройки Ruby On Rails на максимальную производительность: mongrel vs lighttpd vs nginx[/lang_ru]
22 Aug2006

[lang_en]

Because of not fully correct testing methodology, benchmark results are not fully correct. So, I decided to redo all tests. New benchmark results you can get in “Looking For Optimal Solution” series Summary post.

This week we have started one new project with Ruby on Rails as primary framework. My first task was to prepare runtime environment for it on one of our development servers. When I have tried to research how people doing it, I noted that there is no information about how to deploy rails application with nginx as frontend and what is performance of such solution. Before blindly make any decisions about future platform I’ve decided to make some performance tests of the some most popular rails web servers/frontends. Results of these tests you can find here with configuration samples for all software that I have used.

[/lang_en]

[lang_ru]

Из-за возможных ошибок в методике тестирования приведенные результаты могут быть не корректными. Потому бяло принято решение провести тестирование заново с измененными параметрами и набором тестов. Новые результаты тестирования Вы можете получить в серии статей “В Поисках Оптимального Решения” и в статье, описывающей результаты всей серии тестов.

На этой неделе мы начали проект, использующий Ruby on Rails как основное средство разработки. Моей первоочередной задачей являлась настройка окружения на одном из наших development-серверов. Когда я попытался разобраться, как же другие люди запускают и используют RoR, я заметил, что в Internet нет информации о настройке rails-приложений в связке с nginx frontend и нет информации о производительности такого решения. Перед тем, как вслепую выбирать решение для хостинга нового проекта я решил провести небольшое тестирование популярных решений для запуска Rails-приложений. Результаты этих тестов и конфигурационные файлы, использованные при тестировании, вы можете увидеть в этой статье.

[/lang_ru]

Read the rest of this entry


[lang_en]Turning On NCQ Queing On ICH7 Chipsets With Linux[/lang_en][lang_ru]Включение поддержки NCQ Queing на чипсетах ICH7 Chipsets под Linux[/lang_ru]
11 Aug2006

[lang_en]

Recently we’ve got critical load on one of our new free web hosting servers that handles millions of hits per day. When I’ve tried to analyze how to get more performance from that servers, I noted that these servers has ICH7 chipsets and Seagate SATA drives with NCQ support… But in closer view I noticed, that NCQ support is not enabled on our servers with ata_piix IDE driver. So, I decided that it would be great to enable NCQ and take a look what will happen with performance (it was obvious, that performance should increase)…

[/lang_en]

[lang_ru]

Недавно на нескольких из наших серверов, обслуживающих миллионы посещений в сутки, мы достигли предела производительности дисковой подсистемы. Когда я начал анализировать методы, которыми можно исправить ситуацию, я обратил внимание, что на эти сервера имеют чипсеты ICH7 и SATA-диски Seagate с поддержкой NCQ… Но при ближайшем рассмотрении я увидел, что поддержка NCQ не включена на этих серверах с IDE-драйвером ata_piix. Итак, я решил было бы отлично включить поддержку NCQ и взглянуть, как это повлияет на производительность (было очевидно, что она должна увеличиться)…

[/lang_ru]

Read the rest of this entry