squidnt+rejik
squidnt+rejik
Доброго всем времени суток!
Возникла следующая проблема:
Установлен и работает squidNT 2.7 STABLE 8. Из-за чрезмерного желания пользователей поразвлекаться, подключил к сквиду rejik 3.2.6 for Windows для начала с простым баном на odnoklassniki и vkontakte. При запуске squid создаются 5 процессов redirector.exe. Один из них процессорного времени не занимают, остальные 4 делят между собой все свободное процессорное время - загрузка 100% и на squid времени не остается. Загрузка процессора держится, пока не начнешь убивать процессы вручную. Как только процессов остается 2, все приходит в норму и начинает нормально работать. Если изначалбно url_rewrite children установить равным 2, при запуске сквида кратковременно нагрузка второго процесса редиректора поднимается до 100%, а затем падает до 0% и все работает.
squid.conf:
url_rewrite_program c:/squid/sbin/rejik/redirector.exe c:/squid/sbin/rejik/redirector.conf
url_rewrite_children 5.
redirector.conf:
error_log c:/squid/var/logs/redirector.err
change_log c:/squid/var/logs/redirector.log
make-cache c:/squid/sbin/rejik/make-cache
<SOCIAL_NET>
ban_dir c:/squid/sbin/rejik/banlist/social_net
url http://localhost/access_denied.html
redirector.err:
2010-05-27 11:21:55 [3304] Run make-cache (3.2.6)
2010-05-27 11:21:55 [3440] Waiting for make-cache finished
2010-05-27 11:21:55 [3396] Waiting for make-cache finished
2010-05-27 11:21:55 [3384] Waiting for make-cache finished
2010-05-27 11:21:55 [3172] Waiting for make-cache finished
2010-05-27 11:22:21 [3304] Make-cache finished
2010-05-27 11:22:21 [3304] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-27 11:22:21 [3304] Load 0 pattern from SOCIAL_NET pcre
2010-05-27 11:22:21 [3304] Redirector start and working (3.2.6)
2010-05-27 11:26:49 [3172] Make-cache finished detected, continue
2010-05-27 11:26:49 [3172] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-27 11:26:49 [3172] Load 0 pattern from SOCIAL_NET pcre
2010-05-27 11:26:49 [3172] Redirector start and working (3.2.6)
squid cache.log:
2010/05/27 11:21:55| Starting Squid Cache version 2.7.STABLE8 for i686-pc-winnt...
2010/05/27 11:21:55| Running as Squid Windows System Service on Windows XP
2010/05/27 11:21:55| Service command line is: servicecommandline
2010/05/27 11:21:55| Process ID 3332
2010/05/27 11:21:55| With 2048 file descriptors available
2010/05/27 11:21:55| With 2048 CRT stdio descriptors available
2010/05/27 11:21:55| Windows sockets initialized
2010/05/27 11:21:55| Using select for the IO loop
2010/05/27 11:21:55| Performing DNS Tests...
2010/05/27 11:21:55| Successful DNS name lookup tests...
2010/05/27 11:21:55| DNS Socket created at 0.0.0.0, port 2263, FD 5
2010/05/27 11:21:55| Adding nameserver 192.168.X.X from Registry
2010/05/27 11:21:55| Adding domain crystal-sugar.ru from Registry
2010/05/27 11:21:55| helperOpenServers: Starting 5 'redirector.exe' processes
cygwin warning:
MS-DOS style path detected: c:/squid/sbin/rejik/redirector.conf
Preferred POSIX equivalent is: /rejik/redirector.conf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.h ... -pathnames
2010/05/27 11:21:55| helperOpenServers: Starting 3 'ncsa_auth.exe' processes
2010/05/27 11:22:01| User-Agent logging is disabled.
2010/05/27 11:22:01| Referer logging is disabled.
2010/05/27 11:22:01| logfileOpen: opening log c:/squid/var/logs/access.log
2010/05/27 11:22:01| Unlinkd pipe opened on FD 40
2010/05/27 11:22:01| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2010/05/27 11:22:01| Target number of buckets: 425
2010/05/27 11:22:01| Using 8192 Store buckets
2010/05/27 11:22:01| Max Mem size: 8192 KB
2010/05/27 11:22:01| Max Swap size: 102400 KB
2010/05/27 11:22:01| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2010/05/27 11:22:01| logfileOpen: opening log c:/squid/var/logs/store.log
2010/05/27 11:22:01| Rebuilding storage in c:/squid/var/cache (CLEAN)
2010/05/27 11:22:01| Using Least Load store dir selection
2010/05/27 11:22:01| Set Current Directory to c:/squid/var/cache
2010/05/27 11:22:01| Loaded Icons.
2010/05/27 11:22:16| Accepting proxy HTTP connections at 0.0.0.0, port 3128, FD 46.
2010/05/27 11:22:16| Accepting ICP messages at 0.0.0.0, port 3130, FD 47.
2010/05/27 11:22:16| Accepting HTCP messages on port 4827, FD 48.
2010/05/27 11:22:16| Accepting SNMP messages on port 3401, FD 49.
2010/05/27 11:22:16| Ready to serve requests.
2010/05/27 11:22:44| Done reading c:/squid/var/cache swaplog (10 entries)
2010/05/27 11:22:44| Finished rebuilding storage from disk.
2010/05/27 11:22:44| 10 Entries scanned
2010/05/27 11:22:44| 0 Invalid entries.
2010/05/27 11:22:44| 0 With invalid flags.
2010/05/27 11:22:44| 10 Objects loaded.
2010/05/27 11:22:44| 0 Objects expired.
2010/05/27 11:22:44| 0 Objects cancelled.
2010/05/27 11:22:44| 0 Duplicate URLs purged.
2010/05/27 11:22:44| 0 Swapfile clashes avoided.
2010/05/27 11:22:44| Took 43.0 seconds ( 0.2 objects/sec).
2010/05/27 11:22:44| Beginning Validation Procedure
2010/05/27 11:22:44| Completed Validation Procedure
2010/05/27 11:22:44| Validated 10 Entries
2010/05/27 11:22:44| store_swap_size = 136k
2010/05/27 11:22:50| storeLateRelease: released 0 objects
Как побороть данную проблему?
Возникла следующая проблема:
Установлен и работает squidNT 2.7 STABLE 8. Из-за чрезмерного желания пользователей поразвлекаться, подключил к сквиду rejik 3.2.6 for Windows для начала с простым баном на odnoklassniki и vkontakte. При запуске squid создаются 5 процессов redirector.exe. Один из них процессорного времени не занимают, остальные 4 делят между собой все свободное процессорное время - загрузка 100% и на squid времени не остается. Загрузка процессора держится, пока не начнешь убивать процессы вручную. Как только процессов остается 2, все приходит в норму и начинает нормально работать. Если изначалбно url_rewrite children установить равным 2, при запуске сквида кратковременно нагрузка второго процесса редиректора поднимается до 100%, а затем падает до 0% и все работает.
squid.conf:
url_rewrite_program c:/squid/sbin/rejik/redirector.exe c:/squid/sbin/rejik/redirector.conf
url_rewrite_children 5.
redirector.conf:
error_log c:/squid/var/logs/redirector.err
change_log c:/squid/var/logs/redirector.log
make-cache c:/squid/sbin/rejik/make-cache
<SOCIAL_NET>
ban_dir c:/squid/sbin/rejik/banlist/social_net
url http://localhost/access_denied.html
redirector.err:
2010-05-27 11:21:55 [3304] Run make-cache (3.2.6)
2010-05-27 11:21:55 [3440] Waiting for make-cache finished
2010-05-27 11:21:55 [3396] Waiting for make-cache finished
2010-05-27 11:21:55 [3384] Waiting for make-cache finished
2010-05-27 11:21:55 [3172] Waiting for make-cache finished
2010-05-27 11:22:21 [3304] Make-cache finished
2010-05-27 11:22:21 [3304] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-27 11:22:21 [3304] Load 0 pattern from SOCIAL_NET pcre
2010-05-27 11:22:21 [3304] Redirector start and working (3.2.6)
2010-05-27 11:26:49 [3172] Make-cache finished detected, continue
2010-05-27 11:26:49 [3172] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-27 11:26:49 [3172] Load 0 pattern from SOCIAL_NET pcre
2010-05-27 11:26:49 [3172] Redirector start and working (3.2.6)
squid cache.log:
2010/05/27 11:21:55| Starting Squid Cache version 2.7.STABLE8 for i686-pc-winnt...
2010/05/27 11:21:55| Running as Squid Windows System Service on Windows XP
2010/05/27 11:21:55| Service command line is: servicecommandline
2010/05/27 11:21:55| Process ID 3332
2010/05/27 11:21:55| With 2048 file descriptors available
2010/05/27 11:21:55| With 2048 CRT stdio descriptors available
2010/05/27 11:21:55| Windows sockets initialized
2010/05/27 11:21:55| Using select for the IO loop
2010/05/27 11:21:55| Performing DNS Tests...
2010/05/27 11:21:55| Successful DNS name lookup tests...
2010/05/27 11:21:55| DNS Socket created at 0.0.0.0, port 2263, FD 5
2010/05/27 11:21:55| Adding nameserver 192.168.X.X from Registry
2010/05/27 11:21:55| Adding domain crystal-sugar.ru from Registry
2010/05/27 11:21:55| helperOpenServers: Starting 5 'redirector.exe' processes
cygwin warning:
MS-DOS style path detected: c:/squid/sbin/rejik/redirector.conf
Preferred POSIX equivalent is: /rejik/redirector.conf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.h ... -pathnames
2010/05/27 11:21:55| helperOpenServers: Starting 3 'ncsa_auth.exe' processes
2010/05/27 11:22:01| User-Agent logging is disabled.
2010/05/27 11:22:01| Referer logging is disabled.
2010/05/27 11:22:01| logfileOpen: opening log c:/squid/var/logs/access.log
2010/05/27 11:22:01| Unlinkd pipe opened on FD 40
2010/05/27 11:22:01| Swap maxSize 102400 + 8192 KB, estimated 8507 objects
2010/05/27 11:22:01| Target number of buckets: 425
2010/05/27 11:22:01| Using 8192 Store buckets
2010/05/27 11:22:01| Max Mem size: 8192 KB
2010/05/27 11:22:01| Max Swap size: 102400 KB
2010/05/27 11:22:01| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2010/05/27 11:22:01| logfileOpen: opening log c:/squid/var/logs/store.log
2010/05/27 11:22:01| Rebuilding storage in c:/squid/var/cache (CLEAN)
2010/05/27 11:22:01| Using Least Load store dir selection
2010/05/27 11:22:01| Set Current Directory to c:/squid/var/cache
2010/05/27 11:22:01| Loaded Icons.
2010/05/27 11:22:16| Accepting proxy HTTP connections at 0.0.0.0, port 3128, FD 46.
2010/05/27 11:22:16| Accepting ICP messages at 0.0.0.0, port 3130, FD 47.
2010/05/27 11:22:16| Accepting HTCP messages on port 4827, FD 48.
2010/05/27 11:22:16| Accepting SNMP messages on port 3401, FD 49.
2010/05/27 11:22:16| Ready to serve requests.
2010/05/27 11:22:44| Done reading c:/squid/var/cache swaplog (10 entries)
2010/05/27 11:22:44| Finished rebuilding storage from disk.
2010/05/27 11:22:44| 10 Entries scanned
2010/05/27 11:22:44| 0 Invalid entries.
2010/05/27 11:22:44| 0 With invalid flags.
2010/05/27 11:22:44| 10 Objects loaded.
2010/05/27 11:22:44| 0 Objects expired.
2010/05/27 11:22:44| 0 Objects cancelled.
2010/05/27 11:22:44| 0 Duplicate URLs purged.
2010/05/27 11:22:44| 0 Swapfile clashes avoided.
2010/05/27 11:22:44| Took 43.0 seconds ( 0.2 objects/sec).
2010/05/27 11:22:44| Beginning Validation Procedure
2010/05/27 11:22:44| Completed Validation Procedure
2010/05/27 11:22:44| Validated 10 Entries
2010/05/27 11:22:44| store_swap_size = 136k
2010/05/27 11:22:50| storeLateRelease: released 0 objects
Как побороть данную проблему?
Не помогло.
Если использовать левые слэши (c:\squid\etc\redirector.conf) в пути к конф файлу rejik, в cache.log получаю ошибку:
helperHandleRead: unexpected read from url_rewriter #1, 222 bytes 'ERROR: Can't open config file /cygdrive/c/rejik3/redirector.conf: No such file or directory
- и rejik вообще не запускается.
Если использовать путь вида c:\\squid\\etc\\redirector.conf, то rejik запускается, но повторяется ситуация, описанная в первом сообщении темы.
Если использовать левые слэши (c:\squid\etc\redirector.conf) в пути к конф файлу rejik, в cache.log получаю ошибку:
helperHandleRead: unexpected read from url_rewriter #1, 222 bytes 'ERROR: Can't open config file /cygdrive/c/rejik3/redirector.conf: No such file or directory
- и rejik вообще не запускается.
Если использовать путь вида c:\\squid\\etc\\redirector.conf, то rejik запускается, но повторяется ситуация, описанная в первом сообщении темы.
Ситуация все страньше.
1) Полностью удалил rejik.
2) Перезапустил squid (с удаленными url_rewrite_program и url_rewrite children)
3) Заново установил rejik и сконфигурировал его.
4) Перезапустил squid
5) rejik стартовал нормально!!! Кратковременно один из процессов занимал 100% процессорного времени, видимо ожидал построения кэша. Затем загрузка процессора упала до 0.
6) Перезапустил squid. Проблема повторилась.
7) Остановил squid.
redirector.err:
2010-05-31 13:11:39 [636] Run make-cache (3.2.6)
2010-05-31 13:11:40 [276] Waiting for make-cache finished
2010-05-31 13:11:48 [636] Make-cache finished
2010-05-31 13:11:48 [276] Make-cache finished detected, continue
2010-05-31 13:11:48 [276] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:11:48 [276] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:11:48 [276] Redirector start and working (3.2.6)
2010-05-31 13:11:48 [636] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:11:48 [636] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:11:48 [636] Redirector start and working (3.2.6)
2010-05-31 13:11:48 [1788] Run make-cache (3.2.6)
2010-05-31 13:11:48 [1788] Make-cache finished
2010-05-31 13:11:48 [1788] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:11:48 [1788] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:11:48 [1788] Redirector start and working (3.2.6)
2010-05-31 13:11:48 [2224] Run make-cache (3.2.6)
2010-05-31 13:11:48 [2224] Make-cache finished
2010-05-31 13:11:48 [2224] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:11:48 [2224] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:11:48 [2224] Redirector start and working (3.2.6)
2010-05-31 13:11:48 [872] Run make-cache (3.2.6)
2010-05-31 13:11:49 [872] Make-cache finished
2010-05-31 13:11:49 [872] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:11:49 [872] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:11:49 [872] Redirector start and working (3.2.6)
2010-05-31 13:12:43 [1948] Run make-cache (3.2.6)
2010-05-31 13:12:43 [1668] Waiting for make-cache finished
2010-05-31 13:12:43 [1928] Waiting for make-cache finished
2010-05-31 13:12:43 [1944] Waiting for make-cache finished
2010-05-31 13:12:48 [2284] Waiting for make-cache finished
2010-05-31 13:13:18 [1948] Make-cache finished
2010-05-31 13:13:18 [1948] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:13:18 [1948] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:13:18 [1948] Redirector start and working (3.2.6)
2010-05-31 13:20:00 [1668] MAKE-CACHE: ERROR: fcntl return error: Resource deadlock avoided
2010-05-31 13:20:00 [1944] MAKE-CACHE: ERROR: fcntl return error: Resource deadlock avoided
2010-05-31 13:20:00 [1928] MAKE-CACHE: ERROR: fcntl return error: Resource deadlock avoided
2010-05-31 13:20:00 [2284] Make-cache finished detected, continue
2010-05-31 13:20:00 [2284] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:20:00 [2284] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:20:00 [2284] Redirector start and working (3.2.6)
1) Полностью удалил rejik.
2) Перезапустил squid (с удаленными url_rewrite_program и url_rewrite children)
3) Заново установил rejik и сконфигурировал его.
4) Перезапустил squid
5) rejik стартовал нормально!!! Кратковременно один из процессов занимал 100% процессорного времени, видимо ожидал построения кэша. Затем загрузка процессора упала до 0.
6) Перезапустил squid. Проблема повторилась.
7) Остановил squid.
redirector.err:
2010-05-31 13:11:39 [636] Run make-cache (3.2.6)
2010-05-31 13:11:40 [276] Waiting for make-cache finished
2010-05-31 13:11:48 [636] Make-cache finished
2010-05-31 13:11:48 [276] Make-cache finished detected, continue
2010-05-31 13:11:48 [276] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:11:48 [276] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:11:48 [276] Redirector start and working (3.2.6)
2010-05-31 13:11:48 [636] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:11:48 [636] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:11:48 [636] Redirector start and working (3.2.6)
2010-05-31 13:11:48 [1788] Run make-cache (3.2.6)
2010-05-31 13:11:48 [1788] Make-cache finished
2010-05-31 13:11:48 [1788] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:11:48 [1788] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:11:48 [1788] Redirector start and working (3.2.6)
2010-05-31 13:11:48 [2224] Run make-cache (3.2.6)
2010-05-31 13:11:48 [2224] Make-cache finished
2010-05-31 13:11:48 [2224] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:11:48 [2224] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:11:48 [2224] Redirector start and working (3.2.6)
2010-05-31 13:11:48 [872] Run make-cache (3.2.6)
2010-05-31 13:11:49 [872] Make-cache finished
2010-05-31 13:11:49 [872] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:11:49 [872] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:11:49 [872] Redirector start and working (3.2.6)
2010-05-31 13:12:43 [1948] Run make-cache (3.2.6)
2010-05-31 13:12:43 [1668] Waiting for make-cache finished
2010-05-31 13:12:43 [1928] Waiting for make-cache finished
2010-05-31 13:12:43 [1944] Waiting for make-cache finished
2010-05-31 13:12:48 [2284] Waiting for make-cache finished
2010-05-31 13:13:18 [1948] Make-cache finished
2010-05-31 13:13:18 [1948] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:13:18 [1948] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:13:18 [1948] Redirector start and working (3.2.6)
2010-05-31 13:20:00 [1668] MAKE-CACHE: ERROR: fcntl return error: Resource deadlock avoided
2010-05-31 13:20:00 [1944] MAKE-CACHE: ERROR: fcntl return error: Resource deadlock avoided
2010-05-31 13:20:00 [1928] MAKE-CACHE: ERROR: fcntl return error: Resource deadlock avoided
2010-05-31 13:20:00 [2284] Make-cache finished detected, continue
2010-05-31 13:20:00 [2284] Load 2 rules from c:/squid/sbin/rejik/banlist/social_net/urls.cache
2010-05-31 13:20:00 [2284] Load 0 pattern from SOCIAL_NET pcre
2010-05-31 13:20:00 [2284] Redirector start and working (3.2.6)