OpenVPN

Оказывается, я был не прав, заморачиваясь с ipsec, l2tp, pppd и т.п. OpenVPN просто няшечка: 1 порт, TCP, ключи, 1 конфиг и клиенты, настраиваемые в 2 приема.

Башня из лего

Перенос сервера из хостинга в хостинг очень похож на перенос Эйфелевой башни из Лего, которую собрал год назад и выкинул инструкцию: достаточно один раз споткнуться и все, развлечение на вечер готово!

Хозяйке на заметку: L2TP + NAT traversal

Чтобы не забыть: по непонятным причинам у racoon не работает nat traversal, хотя и заявляет, что умеет. Это выражается в том, что 2 клиента в одном NAT’е не могут сосуществовать: пакеты получает последний подключившийся. По результатам танцев вокруг настройки xl2tpd и pppd был выкинут racoon и настроен openswan.

Несколько MX’ов и greylist

Продолжаю наблюдения:

1 – на 2м и 3м MX’ах (почти) нет блокированных. Видимо, боты стучатся только в первый.

2 – некоторые боты очень неизобретательны. Вот, например, несколько дней подряд:

1 61.38.186.117 unknown advertise.bz222@gmail.com admin@mx10.andreybondarenko.com
1 61.38.186.117 unknown advertise.bz222@gmail.com justina4441@mx10.andreybondarenko.com
1 61.38.186.117 unknown advertise.bz222@gmail.com sales@mx10.andreybondarenko.com
1 61.42.104.99 unknown advertise.bz222@gmail.com norene.bujarski@mx10.andreybondarenko.com
1 61.42.104.99 unknown advertise.bz222@gmail.com justina4441@mx10.andreybondarenko.com
1 61.42.104.99 unknown advertise.bz222@gmail.com frequency807@mx10.andreybondarenko.com
1 218.153.247.68 unknown advertise.bz222@gmail.com sales@mx10.andreybondarenko.com
1 220.94.235.200 unknown advertise.bz222@gmail.com soniemann2004@mx10.andreybondarenko.com
1 112.217.228.234 unknown advertise.bz222@gmail.com soniemann2004@mx10.andreybondarenko.com
1 116.193.90.26 unknown advertise.bz222@gmail.com soniemann2004@mx10.andreybondarenko.com
1 110.45.138.138 unknown advertise.bz222@gmail.com norene.bujarski@mx10.andreybondarenko.com

Такое впечатление, что для защиты от спама достаточно 2 MX’a, первый из которых всегда отдает временную ошибку 🙂

Вопрос со спамом

Так как KLMS у меня так и не заработал, то я почитал актуальные заметки на тему борьбы со спамом. Выводов глобально 2:

– системы распределенных хешей, черных списков и т.п. как-то сошли на нет, бесплатные совсем, платные почти. Многие проекты не обновлялись много лет. Самообучающиеся системы – тоже самое: платная поддержка шевелится, бесплатные версии ниочень.
– грейлист + helo restrictions решают проблему на столько, что дальше копать смысла нет. Буквально: настроил себе и все, редкий бот пройдет 4 раза на моих трех MX’ах. Недостатки грейлиста известны, да и черт с ними, я никуда не спешу.

Антиспам

Коллеги, а какой сейчас антиспам хороший есть? Когда я работал в ЛК, у меня были ключики для Касперского Антиспама и он работал хорошо: спам ловил и каши не просил. А сейчас как быть? Спамассасин есть, но он очень плохо работает.

Хозяйке на заметку

Чтобы не забыть пару очевидных вещей:

– при переезде на новые носители по новой точке монтирования CrashPlan’у надо сказать Full Deduping и попросить его пересканировть архив. Тогда он не будет пересылать файлы еще раз.

– selinux может мешать sshd читать authorized_keys, при этом в messages будет тихо.

Nerd p0rno

Чтобы не забыть: unebootlin – говно, после него надо делать “а” на загрузочный раздел из fdisk’а.

Новости Луна-парка

Теперь отказоустойчивость: +2 MX и +2 DNS’а. Полностью переделигировать на себя пока не стал, не знаю с какой сторны подступиться к перекупу GoDaddy. Ксати, если кому зоны надо подержать – обращайтесь.

Кстати, почем “Луна-Парк”: https://www.youtube.com/watch?v=z5tZMDBXTRQ

Centos vs Oracle Lunux

Коллеги справедливо попеняли мне на оценку скорости работы веб-приложения на глаз, что же, попробую исправиться.

Дано: 2 одинаковые virtualbox’ины, где запущены CentOS 6.4 и Oracle Linux 6.4 в конфигурации Web-server по умолчанию с Drupal’ом по умолчанию на MySQL по умолчанию, в котором заведены 2 статьи со стандартным текстом-затычкой. 111 – центось, 112 – оракл. А теперь – танцы:

[root@storage ~]# ab -n 10000 -c 128 http://192.168.2.111/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.2.111 (be patient)
apr_pollset_poll: The timeout specified has expired (70007)
Total of 52 requests completed
[root@storage ~]# ab -n 1000 -c 128 http://192.168.2.111/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.2.111 (be patient)
Completed 100 requests
apr_pollset_poll: The timeout specified has expired (70007)
Total of 130 requests completed
[root@storage ~]# ab -n 1000 -c 128 http://192.168.2.112/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.2.112 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
apr_pollset_poll: The timeout specified has expired (70007)
Total of 865 requests completed
[root@storage ~]# ab -n 500 -c 100 http://192.168.2.111/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.2.111 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests

Server Software: Apache/2.2.15
Server Hostname: 192.168.2.111
Server Port: 80

Document Path: /
Document Length: 11896 bytes

Concurrency Level: 100
Time taken for tests: 437.530 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Total transferred: 6155000 bytes
HTML transferred: 5948000 bytes
Requests per second: 1.14 [#/sec] (mean)
Time per request: 87506.072 [ms] (mean)
Time per request: 875.061 [ms] (mean, across all concurrent requests)
Transfer rate: 13.74 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.9 0 7
Processing: 4700 84105 55641.8 85650 318510
Waiting: 2554 61848 42292.1 59039 232472
Total: 4706 84106 55641.4 85650 318510

Percentage of the requests served within a certain time (ms)
50% 85650
66% 108219
75% 118252
80% 131994
90% 163683
95% 179541
98% 208537
99% 218438
100% 318510 (longest request)
[root@storage ~]# ab -n 500 -c 100 http://192.168.2.112/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.2.112 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests

Server Software: Apache/2.2.15
Server Hostname: 192.168.2.112
Server Port: 80

Document Path: /
Document Length: 11897 bytes

Concurrency Level: 100
Time taken for tests: 318.050 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Total transferred: 6155500 bytes
HTML transferred: 5948500 bytes
Requests per second: 1.57 [#/sec] (mean)
Time per request: 63610.076 [ms] (mean)
Time per request: 636.101 [ms] (mean, across all concurrent requests)
Transfer rate: 18.90 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.6 0 7
Processing: 3790 60702 51397.5 42888 294205
Waiting: 3745 39956 29574.1 32110 202149
Total: 3791 60703 51397.0 42888 294205

Percentage of the requests served within a certain time (ms)
50% 42888
66% 70750
75% 90107
80% 97550
90% 134104
95% 160974
98% 200019
99% 232280
100% 294205 (longest request)
[root@storage ~]# ab -n 500 -c 100 http://192.168.2.111/favicon.ico
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.2.111 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests

Server Software: Apache/2.2.15
Server Hostname: 192.168.2.111
Server Port: 80

Document Path: /favicon.ico
Document Length: 288 bytes

Concurrency Level: 100
Time taken for tests: 0.505 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Non-2xx responses: 500
Total transferred: 234000 bytes
HTML transferred: 144000 bytes
Requests per second: 990.73 [#/sec] (mean)
Time per request: 100.936 [ms] (mean)
Time per request: 1.009 [ms] (mean, across all concurrent requests)
Transfer rate: 452.79 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 2.1 0 8
Processing: 56 93 21.6 93 209
Waiting: 56 93 21.5 93 209
Total: 56 94 21.9 95 216

Percentage of the requests served within a certain time (ms)
50% 95
66% 104
75% 105
80% 107
90% 115
95% 134
98% 142
99% 150
100% 216 (longest request)
[root@storage ~]# ab -n 500 -c 100 http://192.168.2.112/favicon.ico
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.2.112 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests

Server Software: Apache/2.2.15
Server Hostname: 192.168.2.112
Server Port: 80

Document Path: /favicon.ico
Document Length: 288 bytes

Concurrency Level: 100
Time taken for tests: 0.351 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Non-2xx responses: 500
Total transferred: 234000 bytes
HTML transferred: 144000 bytes
Requests per second: 1424.12 [#/sec] (mean)
Time per request: 70.219 [ms] (mean)
Time per request: 0.702 [ms] (mean, across all concurrent requests)
Transfer rate: 650.87 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 2.5 0 12
Processing: 18 61 11.3 59 126
Waiting: 18 61 10.3 58 101
Total: 29 63 10.9 59 126

Percentage of the requests served within a certain time (ms)
50% 59
66% 64
75% 64
80% 65
90% 80
95% 87
98% 91
99% 97
100% 126 (longest request)
[root@storage ~]#