binux / pyspider

A Powerful Spider(Web Crawler) System in Python.
http://docs.pyspider.org/
Apache License 2.0
16.47k stars 3.69k forks source link

Git pyspider version stop from doing any activity at some point of time #613

Closed volvofixthis closed 7 years ago

volvofixthis commented 7 years ago

I mensioned earlier that i have some sort of problem with pyspider getting stalled at some moment. Two versions of pyspider, one from june i think and one is fresh from git. 0.3.8 git https://puu.sh/tiRnt/c5b3b4825c.png 0.3.9 git https://puu.sh/tiRpf/800c11e61c.png another moment of totally stop after restart: https://puu.sh/tjO62/73d1c639fe.png

root@5966f2e8219f:/home/ubuntu/conf# python3 --version 
Python 3.4.3
root@5966f2e8219f:/home/ubuntu/conf# pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.                                                                                                                                                                      
amqp (2.1.4)
backports-abc (0.5)
chardet (2.3.0)
click (6.7)
colorama (0.2.5)
cssselect (1.0.1)
defusedxml (0.4.1)
Django (1.9.9)
elasticsearch (2.3.0)
Flask (0.12)
Flask-Login (0.4.0)
html2text (2016.9.19)
html5lib (0.999)
iso8601 (0.1.11)
itsdangerous (0.24)
Jinja2 (2.9.4)
kombu (4.0.2)
linecache2 (1.0.0)
lxml (3.7.2)
Magic-file-extensions (0.2)
MarkupSafe (0.23)
mysql-connector-python (1.1.6)
mysqlclient (1.3.9)
nltk (3.2.2)
pika (0.10.0)
pip (9.0.1)
psycopg2 (2.6.2)
pycurl (7.43.0)
pymongo (3.4.0)
pyquery (1.2.17)
pyspider (0.3.9, /opt/pyspider)
python-dateutil (2.6.0)
pytz (2016.10)
redis (2.10.5)
requests (2.12.4)
setuptools (3.3)
six (1.10.0)
SQLAlchemy (1.1.4)
tblib (1.3.0)
tornado (4.4.2)
traceback2 (1.4.0)
u-msgpack-python (2.3.0)
unittest2 (1.1.0)
urllib3 (1.19.1)
vine (1.1.3)
Werkzeug (0.11.15)
wheel (0.24.0)
WsgiDAV (2.1.0)

Logs from fresh version are totally without any errors, but logs are just stop writing anything at some point of time. scheduler:

[I 170111 17:58:56 scheduler:906] task done reutov_net:7d3d76fd00e42a463efbdeacff76a8ac http://reutov.net/news/adm/index.php?id_4=20098
[I 170111 17:58:56 scheduler:906] task done reutov_net:baa449004a31bfdac9a1ef34d512fd4d http://reutov.net/news/adm/index.php?id_4=20097
[I 170111 17:58:56 scheduler:906] task done govp_info:c10cf3c533c0d144be15168ebdf9ea22 http://govp.info/strazhi-poryadka-verxnej-pyishmyi-sovmestno-s-obshhestvennyim-sovetom-pozdravili-pobeditelej-konkursa-%C2%ABpolicziya-glazami-detej%C2%BB-s-nastupayushhim-novyim-godom.html
[I 170111 17:58:56 scheduler:906] task done govp_info:f60ffe5d5527940c293efe588203aaee http://govp.info/zemlyaki.-vitalij-gron-%C2%ABpobeda-rozhdaetsya-v-trenazhernom-zale%C2%BB.html
[I 170111 17:58:56 scheduler:906] task done govp_info:b2253f7c3a8d6cecf432ca62e77a349b http://govp.info/pravooxraniteli-verxnej-pyishmyi-proveli-akcziyu-%C2%ABpoliczejskij-ded-moroz%C2%BB.html
[I 170111 17:58:56 scheduler:959] task retry 0/3 news_vtomske_ru:cb5d45d8c60457e1bb749aa7af6054a7 http://news.vtomske.ru/news/135930-ekspert-vysokie-sugroby-mogut-stat-problemoi-dlya-pernatoi-dichi-v-tomskih-lesah
[I 170111 17:58:56 scheduler:959] task retry 0/3 news_vtomske_ru:1ceb802bc94a3279de28197caf871736 http://news.vtomske.ru/news/135984-skr-provodit-proverku-posle-smerti-mujchiny-v-bolnice-tomska
[I 170111 17:58:56 scheduler:959] task retry 0/3 news_vtomske_ru:d9dcb6102aebac7d67a7d4bd25e4598c http://news.vtomske.ru/news/135981-kamaz-razrushil-ledovuyu-perepravu-v-tomskoi-oblasti-perevozya-gusenichnyi-traktor
[I 170111 17:58:56 scheduler:959] task retry 0/3 news_vtomske_ru:4346dd3ae2289afe1942dd9cd41ea67d http://news.vtomske.ru/news/135979-razrabatyvaemye-v-tpu-implantaty-pomogut-organizmu-vyrashchivat-novuyu-kostnuyu-tkan
[I 170111 17:58:56 scheduler:906] task done news_tut_by:693c62edd7122ff166484d50952e49eb https://realty.tut.by/news/money/526956.html
[I 170111 17:58:56 scheduler:906] task done kuban24_tv:5a2df8ac0b390f397cbaea8e3d22cfd5 http://kuban24.tv/item/na-kubani-v-armiyu-za-god-prizvali-13-2-tys-novobrancev-165670
[I 170111 17:58:56 scheduler:959] task retry 0/3 news_tut_by:96473cbb19fcbae9af08d03aa4832df0 http://afisha.tut.by/news/anews/526637.html
[I 170111 17:58:56 scheduler:959] task retry 1/3 nearmoscovv_ru:74224a27eee2042e2aa492df95e685c3 http://nearmoscovv.ru/
[I 170111 17:58:56 scheduler:906] task done my_evp_ru:728e135e83bb6b92dea6f2568971b3e0 http://my-evp.ru/?p=43793
[I 170111 17:58:57 scheduler:906] task done riatomsk_ru:12f49056f1bbc532f1e3ad48779e7a1b https://www.riatomsk.ru/article/20170111/uborka-snega-tomsk-reshenie-problemi/
[I 170111 17:58:57 scheduler:906] task done ramenskoe_biz:eaa2342ad973968415d892badaa13adc http://www.ramenskoe.biz/news/all/1/1308/
[I 170111 17:58:57 scheduler:906] task done uiraion_irkobl_ru:a454ccb61fb3d4412bde373776104104 http://uiraion.irkobl.ru/news/detail.php?ID=36615
[I 170111 17:58:57 scheduler:906] task done in_reutov_ru:b45df2f2de67dfcf1945c7ea6f5d6b46 http://in-reutov.ru/novosti/sport/v-reutove-proshli-sorevnovaniya-po-skandinavskoy-hodbe
[I 170111 17:58:57 scheduler:959] task retry 0/3 karelinform_ru:f939d5725b3da8abc8c42f4693493606 http://karelinform.ru/news/society/87601/privlekatelnaya_vakansiya_opasnoe_zabolevanie_i_trehnogaya_devushka_5_samyih_chitaemyih_novostey_za_segodnya

fetcher:

[I 170111 17:59:05 tornado_fetcher:419] [200] 2goroda_ru:eb9694ab16c24450ed83cd4c3eea885b http://2goroda.ru/news 7.70s
[I 170111 17:59:05 tornado_fetcher:419] [200] kursktv_ru:7911a621fb7ac100f95645bca2433d8a http://kursktv.ru/news/vladimir-putin-potreboval-soblyudat-prava-zaklyuchennyh-v-mestah-lisheniya-svobody.html 7.74s
[I 170111 17:59:05 tornado_fetcher:419] [200] kursktv_ru:493270917fe30cb38f2d1b625902cb54 http://kursktv.ru/news/kursk-policeyskie-vychislili-prestupnika-po-poteryannomu-telefonu.html 7.74s
[I 170111 17:59:11 tornado_fetcher:419] [200] today_kz:815f5e88363f21af38e7edb7b084f216 http://today.kz/news/zhizn/2017-01-11/733742-deputatam-rasskazali-o-rashodovanii-sobrannyih-deneg-dlya-zhitelej-shahana/ 14.14s
[I 170111 17:59:11 tornado_fetcher:419] [200] my_evp_ru:2f45d06f17338a2573985c119d3b74f7 http://my-evp.ru/?p=43799 30.29s
[I 170111 17:59:11 tornado_fetcher:419] [200] my_evp_ru:746111b99579d44cf9983c53530c4e5a http://my-evp.ru/?p=43727 30.22s
[I 170111 17:59:11 tornado_fetcher:419] [200] my_evp_ru:71d082f2ed25948416e2238de8bad3f5 http://my-evp.ru/?p=43670 30.21s
[I 170111 17:59:11 tornado_fetcher:419] [200] my_evp_ru:d14347df9f783906d9135c0ca1cde4bb http://my-evp.ru/?p=43810 30.22s
[I 170111 17:59:12 tornado_fetcher:419] [200] reutov_net:4db10dbb1813b52119d68efd94a34211 http://reutov.net/news/index.php?id_4=20054 15.41s
[I 170111 17:59:12 tornado_fetcher:419] [200] reutov_net:3877efd9ed70f56f815d60e07b770724 http://reutov.net/news/adm/index.php?id_4=20154 15.40s
[I 170111 17:59:12 tornado_fetcher:419] [200] nezavisimaya_pereslavl_rf:4ca9b71017317caeb207b55ec9184cc2 http://xn----7sbabhdpeaona7bchj7btmi9u2b.xn--p1ai/?cat=92 15.40s
[I 170111 17:59:12 tornado_fetcher:419] [200] nezavisimaya_pereslavl_rf:dac1a222c99e966b4a4cde9f588052a5 http://xn----7sbabhdpeaona7bchj7btmi9u2b.xn--p1ai/?cat=11 15.39s
[I 170111 17:59:12 tornado_fetcher:419] [200] reutov_net:951c62a91a122dccae5e53287629f6f5 http://reutov.net/news/index.php?id_4=19949 15.39s
[I 170111 17:59:12 tornado_fetcher:419] [200] govp_info:45c7299df4ac029107445cee0019815e http://govp.info/novosti/kultura 15.38s
[I 170111 17:59:12 tornado_fetcher:419] [200] govp_info:01496ce31d82a89a009463bc26fc0791 http://govp.info/novosti/zhkkh 15.38s
[I 170111 17:59:12 tornado_fetcher:419] [200] govp_info:65a480559f457e6b0886af8e220027c3 http://govp.info/novosti/politika 15.38s
[I 170111 17:59:12 tornado_fetcher:419] [200] nezavisimaya_pereslavl_rf:66276a3cca5ad26c65827eaf2ff8ed49 http://xn----7sbabhdpeaona7bchj7btmi9u2b.xn--p1ai/?cat=36 15.37s
[I 170111 17:59:12 tornado_fetcher:419] [200] reutov_net:54f55935c0fe2014e83b17a91fed6a62 http://reutov.net/news/adm/index.php?id_4=20147 15.34s
[I 170111 17:59:12 tornado_fetcher:419] [200] news_tut_by:fd8fcc9b62e3fb4c3ff8c3fd3b994b61 https://realty.tut.by/news/rent/526926.html 15.34s
[I 170111 17:59:12 tornado_fetcher:419] [200] govp_info:247067712a971c0a00c5633258ebc42e http://govp.info/novosti/blagoustroistvo 15.33s
[I 170111 17:59:12 tornado_fetcher:419] [200] govp_info:86f045e82d9e42b68c56834b20a87a20 http://govp.info/novosti/obshchestvo 15.33s
[I 170111 17:59:12 tornado_fetcher:419] [200] news_vtomske_ru:084c6ff9fb4ee60ade72f821edfed599 http://news.vtomske.ru/news/135956-v-asino-sgorel-ceh-po-proizvodstvu-pallet-vmeste-s-oborudovaniem 15.35s
[I 170111 17:59:12 tornado_fetcher:419] [200] news_vtomske_ru:89389e98daa49407340b5527e9019345 http://news.vtomske.ru/news/135960-iz-za-anomalnyh-snegopadov-pod-tomskom-otkroyut-2-rezervnyh-poligona 15.35s
[I 170111 17:59:12 tornado_fetcher:419] [200] gazetanga_ru:76152ce74e55ef45f67faab3a5f97711 http://gazetanga.ru/category/oblast 15.39s
[I 170111 17:59:12 tornado_fetcher:419] [200] gazetanga_ru:70ead44a90f85aabd50c140af2977670 http://gazetanga.ru/category/interviu 15.39s
[I 170111 17:59:12 tornado_fetcher:419] [200] gazetanga_ru:5e1475c9fd2421f80f056210419a7d6a http://gazetanga.ru/category/proishestvia 15.33s
[I 170111 17:59:12 tornado_fetcher:419] [200] gazetanga_ru:8cdb67aea6498c0124048a2e90dd6b6b http://gazetanga.ru/category/obshestvo 15.42s
[E 170111 17:59:12 tornado_fetcher:212] [599] zelenodolsk_ru:f4ed3278ecca69972fcd471e9893570d http://www.zelenodolsk.ru/, HTTP 599: Operation timed out after 14087 milliseconds with 16234 bytes received 15.33s
[I 170111 17:59:12 tornado_fetcher:419] [200] news_tut_by:90f2f93de2a57ebc1ff6e9a5828f98d9 https://auto.tut.by/news/accidents/527033.html 15.35s
[I 170111 17:59:12 tornado_fetcher:419] [200] news_vtomske_ru:ddc53c890d55b0c49dfddd05669a41cc http://news.vtomske.ru/news/134130-vozmojnost-stroitelstva-cbk-v-belom-yaru-podtverdili-privlechennye-eksperty 15.35s
[I 170111 17:59:15 tornado_fetcher:419] [200] m_8422city_ru:4a58ddf3a70939b42a0a2897ebe9ba62 http://m.8422city.ru/news/1504621 4.00s
[I 170111 17:59:15 tornado_fetcher:419] [200] m_8422city_ru:7911c1e803a5787fd09159a67b18325d http://m.8422city.ru/article/1505198 3.98s
[I 170111 17:59:15 tornado_fetcher:419] [200] m_8422city_ru:0269154dec9c2c317dbdfcc407d1a75d http://m.8422city.ru/news/1506540 4.00s
[I 170111 17:59:15 tornado_fetcher:419] [200] nur_kz:f12e3fc650bb39e2ad45946dd1393d57 https://www.nur.kz/ 18.15s

processor:

[I 170111 17:59:12 processor:201] process news_tut_by:25cc4cf0df4b3af9233b329208d74b17 https://news.tut.by/society/526645.html -> [200] len:103965 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:13 processor:201] process 2goroda_ru:de7eaff183a6e047300ba841e0948949 http://2goroda.ru/news/byvshaya-rabotnica-policii-obvinyaetsya-v-hishchenii -> [200] len:128562 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:13 processor:201] process news_tut_by:76464ee2281230daeb015593db5ed8db https://realty.tut.by/news/offtop-realty/526824.html -> [200] len:93350 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:13 processor:201] process 3652_ru:c4753cdc6ad764730109895797c946e1 http://www.3652.ru/article/1506342 -> [200] len:87854 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:13 processor:201] process kamyshlovsky_region_ru:c2bff503bcc7b65a7d5bca248742b219 http://kamyshlovsky-region.ru/about/info/news/1854/ -> [200] len:145998 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:13 processor:201] process zhodinonews_by:c6e6545f23b8acbb1ea1be46acb0c922 http://www.zhodinonews.by/?p=52523 -> [304] len:0 -> result:None fol:0 msg:0 err:None
[I 170111 17:59:13 processor:201] process ramenskoe_biz:0220be403ee37620b54dfea0a2b7d5d9 http://www.ramenskoe.biz/news/all/1/1306/ -> [200] len:39004 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:13 processor:201] process ozersk74_ru:679b6c5cd1294d14d8b45345d60e6d8c http://ozersk74.ru/news/city/345150.php -> [200] len:128047 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:13 processor:201] process kamyshlovsky_region_ru:a6d5b41d6b383243552018c27de58eac http://kamyshlovsky-region.ru/about/info/news/1838/ -> [304] len:0 -> result:None fol:0 msg:0 err:None
[I 170111 17:59:13 processor:201] process dnr24_su:cf771ba34d07c42722cd1e2709f385de http://dnr24.su/extra-news/17105-pozdravlenie-s-novym-godom-ot-redakcii-dnr24.html -> [200] len:48328 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:13 processor:201] process kstnews_kz:20c65f23206709b3116d3bd7438302e4 http://kstnews.kz/news/society?node=34735 -> [200] len:30661 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:14 processor:201] process altgazeta_ru:64278eb78e4871b2ad2cf40ae2e7fd7b http://altgazeta.ru/news/8843-zhestokost-rodnykh-i-miloserdie-chuzhikh -> [200] len:63609 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:14 processor:201] process zhodinonews_by:3e769566b850f904936772c7fe62834e http://www.zhodinonews.by/?p=52551 -> [200] len:97287 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:14 processor:201] process korenovsk_gorod_ru:869d2e1bb23b9b752a9a9df475f12f6e http://korenovsk-gorod.ru/about/info/news/ -> [200] len:82360 -> result:None fol:15 msg:0 err:None
[I 170111 17:59:14 processor:201] process chehov_vid_ru:20fa11d97f56a96c1c4c35e12b1718ad http://chehov-vid.ru/news/pervyimi-v-2017-godu-v-chehove-rodilis-malchiki.html -> [200] len:106837 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:14 processor:201] process chehov_vid_ru:07eef6368aa4369e8f69fc377ff3c066 http://chehov-vid.ru/news/mnogodetnyih-chehovskogo-rayona-lishili-lgot-v-muzyikalnyih-shkolah.html -> [200] len:115868 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:14 processor:201] process 2goroda_ru:193de7ea949217a82f6adf321e34f419 http://2goroda.ru/news/zarplaty-rukovoditeley-i-rabotnikov-kurs-na-sblizhenie -> [200] len:120232 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:15 processor:201] process chehov_vid_ru:15e1572a49188198916a5df413e8514e http://chehov-vid.ru/news/v-chehove-zaderzhan-podozrevaemyiy-v-krazhe-na-100-tyisyach-rubley.html -> [200] len:105665 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:15 processor:201] process kzn_ru:839af32ba8267115caae0e76b954ee5a http://www.kzn.ru/news/57316-v-fevrale-kazantsy-budut-otdyhat-4-dnya-podryad -> [200] len:54384 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:15 processor:201] process nn_ru:27c2983f92b27996739942ae5a5af75f http://www.nn.ru/news/more/voditel_marshrutki_iznasiloval_devushkukonduktora/50228511/ -> [200] len:100888 -> result:{'title':  fol:0 msg:0 err:None
[I 170111 17:59:15 processor:201] process today_kz:cc2afd01345031224eed7523220a08f0 http://today.kz/news/proisshestviya/2017-01-11/733707-arestovannyij-bigeldyi-gabdullin-priznal-svoyu-vinu/ -> [200] len:324939 -> result:{'body': ' fol:0 msg:0 err:None
[I 170111 17:59:15 processor:201] process nn_ru:44921c59b0345c84a9b0ac827ccbd41e http://www.nn.ru/news/more/sergey_belov_ne_soglasen_s_dvoykoy_za_2016_god/50228931/ -> [200] len:109839 -> result:{'title':  fol:0 msg:0 err:None

result worker:

2017-01-11 17:59:32,725 [result] [app_0] Message from: govp_info
2017-01-11 17:59:32,885 [result] [app_116] {"news_id":551467,"title":"Строительство трамвайной линии до Верхней Пышмы подорожало в три раза","pic":"http://cms.moygorod.mobi/files/news/4e2a807699400.jpg","origin_title":"goVP.info | Информационный сайт Верхней Пышмы и Среднеуральска","origin_link":"http://govp.info/stroitelstvo-tramvajnoj-linii-do-verxnej-pyishmyi-podorozhalo-v-tri-raza.html","body":"Межмуниципальный проект на сегодняшний день оценивается в сумму 2,5–2,7 миллиарда рублей. В начале января 2016 года специалисты оценивали стоимость прокладки трамвайной линии в миллиард рублей. Магистраль будет работать по принципу наземного метро и пройдет от станции метро «Проспект Космонавтов», через улицу Шефская и новый высотный микрорайон «Северная корона», а затем повернет на проспект Космонавтов и дойдет до ЕКАД.\n\nНеделю назад депутаты Законодательного собрания Свердловской области выделили на 2017 год Екатеринбургу и Верхней Пышме 300 миллионов рублей на реализацию проекта. При этом те 134 миллиона рублей, которые направят в бюджет уральской столицы, пойдут на отселение частного сектора и, возможно, технологическое присоединение (прокладка кабельной трассы, строительство питания для трамвайных сетей).\n\nДо конца года специалисты мэрии отдадут документы на госэкспертизу со сметной стоимостью 1,9 миллиарда рублей. При этом в горадминистрации уточнили, что они проектируют линию только до северной границы Екатеринбурга, в пышминской части — свой заказчик. Всего потратят порядка 2,5–2,7 миллиарда рублей. Темпы строительства будут зависеть от размера финансирования. Летом в Верхней Пышме и Екатеринбурге состоялись общественные слушания, на которых звучала цифра и выше. Цена складывается непосредственно на прокладку путей и инфраструктуры и затрат на отселение жителей частного сектора вдоль проспекта Космонавтов.\n\nСколько денег в итоге уйдет на выкуп земельных участков у людей, неизвестно. Здесь все зависит от сговорчивости самих собственников и позиции городских властей, которые могут, например, принудительно изъять землю через суд. Согласно постановлению мэрии, ради трамвайной линии в Верхнюю Пышму планируются изъять в Екатеринбурге 20 земельных участков общей площадью 36 тысяч 790 квадратных метров и 16 объектов недвижимости, расположенных на них. Это дома на улицах Чуцкаева и проспекту Космонавтов, - пишет 66.RU","updated_at":1482145964,"published":1,"highlight":0,"promoted":0,"application_id":116,"is_deleted":0,"featured":1,"date":"2016-12-19 16:12:43","robot":1,"source_name":"govp_info","pictures":[]}
{'title': 'Строительство трамвайной линии до Верхней Пышмы подорожало в три раза', 'published': 1, 'origin_title': 'goVP.info | Информационный сайт Верхней Пышмы и Среднеуральска', 'date': '2016-12-19 22:59:00', 'body': 'Межмуниципальный проект на сегодняшний день оценивается в сумму 2,5–2,7 миллиарда рублей. В начале января 2016 года специалисты оценивали стоимость прокладки трамвайной линии в миллиард рублей. Магистраль будет работать по принципу наземного метро и пройдет от станции метро «Проспект Космонавтов», через улицу Шефская и новый высотный микрорайон «Северная корона», а затем повернет на проспект Космонавтов и дойдет до ЕКАД.\n\nНеделю назад депутаты Законодательного собрания Свердловской области выделили на 2017 год Екатеринбургу и Верхней Пышме 300 миллионов рублей на реализацию проекта. При этом те 134 миллиона рублей, которые направят в бюджет уральской столицы, пойдут на отселение частного сектора и, возможно, технологическое присоединение (прокладка кабельной трассы, строительство питания для трамвайных сетей).\n\nДо конца года специалисты мэрии отдадут документы на госэкспертизу со сметной стоимостью 1,9 миллиарда рублей. При этом в горадминистрации уточнили, что они проектируют линию только до северной границы Екатеринбурга, в пышминской части — свой заказчик. Всего потратят порядка 2,5–2,7 миллиарда рублей. Темпы строительства будут зависеть от размера финансирования. Летом в Верхней Пышме и Екатеринбурге состоялись общественные слушания, на которых звучала цифра и выше. Цена складывается непосредственно на прокладку путей и инфраструктуры и затрат на отселение жителей частного сектора вдоль проспекта Космонавтов.\n\nСколько денег в итоге уйдет на выкуп земельных участков у людей, неизвестно. Здесь все зависит от сговорчивости самих собственников и позиции городских властей, которые могут, например, принудительно изъять землю через суд. Согласно постановлению мэрии, ради трамвайной линии в Верхнюю Пышму планируются изъять в Екатеринбурге 20 земельных участков общей площадью 36 тысяч 790 квадратных метров и 16 объектов недвижимости, расположенных на них. Это дома на улицах Чуцкаева и проспекту Космонавтов, - пишет 66.RU', 'origin_link': 'http://govp.info/stroitelstvo-tramvajnoj-linii-do-verxnej-pyishmyi-podorozhalo-v-tri-raza.html', 'source_name': 'govp_info'}
2017-01-11 17:59:32,885 [result] [app_116] 2016-12-19 22:59:00
2017-01-11 17:59:32,885 [result] [app_116] http://govp.info/stroitelstvo-tramvajnoj-linii-do-verxnej-pyishmyi-podorozhalo-v-tri-raza.html
2017-01-11 17:59:32,885 [result] [app_116] 200
2017-01-11 17:59:32,885 [result] [app_116] {'Connection': 'keep-alive', 'Content-Type': 'application/json; charset=UTF-8', 'Vary': 'Accept-Encoding', 'Date': 'Wed, 11 Jan 2017 17:59:33 GMT', 'Server': 'nginx', 'Transfer-Encoding': 'chunked', 'Content-Encoding': 'gzip'}
2017-01-11 17:59:32,885 [result] [app_116] {"news_id":551467,"title":"Строительство трамвайной линии до Верхней Пышмы подорожало в три раза","pic":"http://cms.moygorod.mobi/files/news/4e2a807699400.jpg","origin_title":"goVP.info | Информационный сайт Верхней Пышмы и Среднеуральска","origin_link":"http://govp.info/stroitelstvo-tramvajnoj-linii-do-verxnej-pyishmyi-podorozhalo-v-tri-raza.html","body":"Межмуниципальный проект на сегодняшний день оценивается в сумму 2,5–2,7 миллиарда рублей. В начале января 2016 года специалисты оценивали стоимость прокладки трамвайной линии в миллиард рублей. Магистраль будет работать по принципу наземного метро и пройдет от станции метро «Проспект Космонавтов», через улицу Шефская и новый высотный микрорайон «Северная корона», а затем повернет на проспект Космонавтов и дойдет до ЕКАД.\n\nНеделю назад депутаты Законодательного собрания Свердловской области выделили на 2017 год Екатеринбургу и Верхней Пышме 300 миллионов рублей на реализацию проекта. При этом те 134 миллиона рублей, которые направят в бюджет уральской столицы, пойдут на отселение частного сектора и, возможно, технологическое присоединение (прокладка кабельной трассы, строительство питания для трамвайных сетей).\n\nДо конца года специалисты мэрии отдадут документы на госэкспертизу со сметной стоимостью 1,9 миллиарда рублей. При этом в горадминистрации уточнили, что они проектируют линию только до северной границы Екатеринбурга, в пышминской части — свой заказчик. Всего потратят порядка 2,5–2,7 миллиарда рублей. Темпы строительства будут зависеть от размера финансирования. Летом в Верхней Пышме и Екатеринбурге состоялись общественные слушания, на которых звучала цифра и выше. Цена складывается непосредственно на прокладку путей и инфраструктуры и затрат на отселение жителей частного сектора вдоль проспекта Космонавтов.\n\nСколько денег в итоге уйдет на выкуп земельных участков у людей, неизвестно. Здесь все зависит от сговорчивости самих собственников и позиции городских властей, которые могут, например, принудительно изъять землю через суд. Согласно постановлению мэрии, ради трамвайной линии в Верхнюю Пышму планируются изъять в Екатеринбурге 20 земельных участков общей площадью 36 тысяч 790 квадратных метров и 16 объектов недвижимости, расположенных на них. Это дома на улицах Чуцкаева и проспекту Космонавтов, - пишет 66.RU","updated_at":1482145964,"published":1,"highlight":0,"promoted":0,"application_id":116,"is_deleted":0,"featured":1,"date":"2016-12-19 16:12:43","robot":1,"source_name":"govp_info","pictures":[]}

configuration:

version: '2'
services:
  phantomjs:
    image: laki9/pyspider:git_python3
    command: 'phantomjs --auto-restart true -- --ignore-ssl-errors=true --load-images=false --max-disk-cache-size=100000'
    cpu_shares: 512
    environment:
      - 'EXCLUDE_PORTS=5000,23333,24444'
    expose:
      - '25555'
    mem_limit: 500m
    restart: always
  phantomjs-lb:
    image: dockercloud/haproxy:latest
    links:
      - phantomjs
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    restart: always
  splash:
    image: scrapinghub/splash
    cpu_shares: 512
    environment:
      - 'EXCLUDE_PORTS=5023,8051'
    expose:
      - '8050'
    mem_limit: 500m
    restart: always
  splash-lb:
    image: dockercloud/haproxy:latest
    links:
      - splash
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    restart: always
  fetcher:
    image: laki9/pyspider:git_python3
    external_links:
      - 'mysql:mysql'
      - 'news-redis:redis'
    command: '--config config.json fetcher --xmlrpc --poolsize 100 --phantomjs-endpoint "phantomjs:80" --splash-endpoint "http://splash:80/execute"'
    working_dir: /home/ubuntu/conf
    cpu_shares: 512
    links:
      - 'phantomjs-lb:phantomjs'
      - 'splash-lb:splash'
    volumes:
      - ./conf:/home/ubuntu/conf
    mem_limit: 128m
    restart: always
  result:
    image: laki9/pyspider:git_python3
    external_links:
      - 'mysql:mysql'
      - 'news-redis:redis'
    command: '--config config.json result_worker'
    working_dir: /home/ubuntu/conf
    volumes:
      - ./conf:/home/ubuntu/conf
    restart: always
  processor:
    image: laki9/pyspider:git_python3
    external_links:
      - 'mysql:mysql'
      - 'news-redis:redis'
    command: '--config config.json processor'
    working_dir: /home/ubuntu/conf
    volumes:
      - ./conf:/home/ubuntu/conf
      - /data/files/cian_imgs:/data/files/cian_imgs
    restart: always
  scheduler:
    image: laki9/pyspider:git_python3
    external_links:
      - 'mysql:mysql'
      - 'news-redis:redis'
    command: '--config config.json scheduler'
    working_dir: /home/ubuntu/conf
    volumes:
      - ./conf:/home/ubuntu/conf
    restart: always
  webui:
    image: laki9/pyspider:git_python3
    external_links:
      - 'mysql:mysql'
      - 'news-redis:redis'
    links:
      - scheduler
      - 'phantomjs-lb:phantomjs'
      - 'fetcher:fetcher'
    command: '--config config.json webui --scheduler-rpc "http://scheduler:23333/" --fetcher-rpc "http://fetcher:24444/"  --cdn "//cdnjs.cloudflare.com/ajax/libs/"'
    working_dir: /home/ubuntu/conf
    ports:
      - "5000:5000"
    volumes:
      - ./conf:/home/ubuntu/conf
    restart: always

typical project:

#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Created on 2016-07-04 18:26:00
# Project: znamensk_info

from pyspider.libs.base_handler import *
import re
import datetime
from lxml import etree, html
import urllib.parse
import copy
import codecs
from pytz import timezone
import unicodedata
import iso8601

def get_first(elem_arr):
    return (elem_arr[:1] or [None])[0]

def get_last(elem_arr):
    return (elem_arr[-1:] or [None])[0]

def get_date_from_isoformat(date_string):
    return iso8601.parse_date(date_string.strip()).strftime("%Y-%m-%d %H:%M:%S")

def convert_to_text(etree_arr, level=0, title=""):
    bad_tags = ['script', 'style', 'iframe', 'small', 'table', 'time']
    bad_styles = ['text-align:right', 'font-size:11', 'font-size:10', 'font-size:9', 'font-size:8', 'display:none']
    bad_classes = ['previous', 'caption', 'date', 'tags', 'share', 'insert', 'image', 'gallery', 'messange', 'related', 'interact', 'mcepaste', 'over_news', 'pic', 'photo', 'created', 'count', 'incision', 'heading', 'footnote', 'title', 'extra', 'headline', 'similar', 'relpost', 'respond', 'inject', 'hc-',
                    'preview', 'crumb', 'embed', 'print', 'c_lgr', 'viewer', 'elem-data', 'social', 'author', 'meta', 'img', 'instagram', 'rating', 'copyright', 'more', 'fancybox', 'submitted', 'comment', 'mc-', 'info' , 'poll', 'next', 'descr', 'back', 'counter', 'keyword', 'hidden', 'source']
    bad_words = ['JavaScript', 'Ctrl+Enter']
    bad_words1 = ['источник:', 'фото:', 'теги:', 'показов:', 'просмотров:', 'читать также:', 'видео:']
    text_buf = ''
    for etree in etree_arr:
        if hasattr(etree, 'tag') and etree.tag == 'br':
            text_buf += '\n'
        elif hasattr(etree, 'tag'):
            if any(tag == etree.tag for tag in bad_tags):
                continue

            flag = False

            if level > 0:
                for tag in ['class', 'id', 'itemprop']:
                    if tag in etree.attrib:
                        if any(b in etree.attrib[tag].lower().replace(' ', '') for b in bad_classes):
                            flag = True 

                if 'style' in etree.attrib:
                    if any(b in etree.attrib['style'].lower().replace(' ', '') for b in bad_styles):
                        flag = True

            if flag:
                continue

            if 'align' in etree.attrib and 'right' in etree.attrib['align']:
                continue

            text_tmp = convert_to_text(etree.xpath('./*|./text()'), level + 1, title)

            if any(word in text_tmp for word in bad_words) or text_tmp.strip() == title:
                continue

            if len(etree.xpath('./text()')) > 0 and any(word in get_first(etree.xpath('./text()')).lower().replace(' ', '') for word in bad_words1):
                continue 

            text_buf += text_tmp
            h = re.compile("^h\d")
            if etree.tag == 'p' or etree.tag == 'div' or h.match(etree.tag):
                text_buf += '\n\n'
            if etree.tag == 'li':
                text_buf += '\n'
        else:
            if any(word in etree.lower().replace(' ', '') for word in bad_words1):
                continue 
            etree = etree.replace("\n", "")
            text_buf += etree

    text_buf = fix_string(text_buf)
    return text_buf

def fix_string(s):
    s = s.replace("\xa0", " ")
    s = s.replace("\u200a", "")
    s = s.replace("\u200b", "")
    s = s.replace("\xad", "")
    s = s.replace("\u202f", " ")
    s = s.replace("\x97", "-")
    s = s.replace("\u2009", " ")
    s = s.replace('\r', '')
    s = s.replace('\t', '')
    s = re.sub(r'[ ]+', ' ', s)
    s = re.sub(r'\n \n', '\n\n', s)
    s = re.sub(r'[\n]{3,}', '\n\n', s)
    return s

def get_video_id(value):
    query = urllib.parse.urlparse(value)
    if query.hostname == 'youtu.be':
        return query.path[1:]
    if query.hostname in ('www.youtube.com', 'youtube.com'):
        if query.path == '/watch':
            p = parse_qs(query.query)
            return p['v'][0]
        if query.path[:7] == '/embed/':
            return query.path.split('/')[2]
        if query.path[:3] == '/v/':
            return query.path.split('/')[2]
    return None

def get_youtube(content):
    youtube_objs = content.xpath('.//iframe[contains(@src, "youtu")]|.//embed[contains(@src, "youtu")]')
    video_urls = []
    for youtube_obj in youtube_objs:
        video_id = get_video_id(youtube_obj.attrib['src'])
        if video_id is not None:
            video_urls.append('https://www.youtube.com/watch?v=' + video_id)
    return video_urls

def get_date(date_str, tz='Europe/Moscow'):
    # months = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря']
    # months = ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь']
    months = ['янв', 'фев', 'мар', 'апр', 'ма', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек']
    now = datetime.datetime.now(timezone(tz))
    date_str = date_str.replace("\xa0", "").lower()
    date_str = date_str.strip()
    date_str = re.sub(r'[ \n]+', ' ', date_str)
    date_arr = date_str.split(' ')
    # обработка даты типа вчера, 14:56
    if "вчера" in date_str:
        d = now - datetime.timedelta(days=1)
        year = d.year
        month = d.month
        day = d.day
    # обработка даты типа  Сегодня в 18:29
    elif "сегодня" in date_str:
        year = now.year
        month = now.month
        day = now.day
    elif len([i for i, x in enumerate(months) if x in date_str]) > 0:
        month = [i for i, x in enumerate(months) if x in date_str][0] + 1
        year = now.year
        while 1:
            try: 
                day = int(date_arr[0])
                break
            except ValueError:
                date_arr.pop(0)
    # обработка даты типа 28 апреля 2016, 16:29
    else:
        re_obj = re.search(r'([0-9]+)\.([0-9]+)\.([0-9]+)', date_str)
        if re_obj is not None:
            year = int(re_obj.group(3))
            if len(str(year)) == 2:
                year += 2000
            day = int(re_obj.group(1))
            month = int(re_obj.group(2))
        else:
            year = now.year
            month = now.month
            day = now.day
    time_match = re.search(r'([0-9]+):([0-9]+)', date_str)
    if time_match:
        hour = int(time_match.group(1))
        minute = int(time_match.group(2))
    else:
        hour = now.hour
        minute = now.minute
    return datetime.datetime(year, month, day, hour, minute).strftime("%Y-%m-%d %H:%M:%S")

class Handler(BaseHandler):
    crawl_config = {
        'itag': 'v3'
    }

    tz = 'Europe/Samara'
    base = 'http://znamensk.info/'

    @every(minutes=3)
    def on_start(self):
        self.crawl('http://znamensk.info/news', callback=self.index_page)

    @config(age=3 * 60)
    def index_page(self, response):
        i = 0
        response.encoding = 'utf-8'
        for each in response.etree.xpath('//div[@class="post-title"]//h3//a//@href'):
            url = urllib.parse.urljoin(self.base, each)
            if self.base not in url or self.base == url or '/#' in url:
                continue
            self.crawl(url, headers={'user-agent': 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'}, callback=self.detail_page)
            i += 1
            if i == 15:
                break

    @config(priority=2, age=60 * 60)
    def detail_page(self, response):
        result_obj = {'origin_link': urllib.parse.unquote(response.url), 'origin_title': 'Информационный портал Znamensk.info', 'published': 1}
        response.encoding = 'utf-8'

        content = get_first(response.etree.xpath('//article'))

        result_obj['video_urls'] = get_youtube(content)

        if len(content.xpath('.//div[contains(@class, "field-type-text-with-summary")]//table[not(.//img)]')) > 0:
            return dict()

        # картинка
        img_path = get_first(content.xpath('.//div[contains(@class, "field-type-image")]//img//@src[not(contains(., ".gif"))]'))

        if img_path is not None:
            img_path = urllib.parse.urljoin(self.base, img_path)
            result_obj['img_src'] = img_path

        # заголовок
        title = get_first(content.xpath('.//h1/a/text()')).strip()
        result_obj['title'] = fix_string(title)

        # текст
        result_obj['body'] = convert_to_text(content.xpath('.//div[contains(@class, "field-type-text-with-summary")]'), 0, title).strip()
        if len(result_obj['body']) < 50:
            result_obj['body'] = ''

        # дата
        date_str = get_first(content.xpath('.//span[contains(@class, "post-created")]/text()')).strip()
        print(date_str)
        result_obj['tz'] = self.tz
        result_obj['date'] = get_date(date_str, self.tz)

        return result_obj

Maybe you have idea why same projects works ok under old version but not with new one? Number of projects are around 500. I tried fresh install with few projects it working ok. How i can debug this situation? Is there way to really check out what fill my queue?

Maybe this can add some clearance. I notice that process is not instant, i see slow down and at some point all stop working at all.

For testing purpose tried increase number of result, processor, scheduler and fetcher when pyspider stoped doing something. It alive again, but for how long...

Strange, with increased containers all working ok...

binux commented 7 years ago

Thanks for the details, seems it's blocked somewhere in scheduler, will investigate that.

volvofixthis commented 7 years ago

can i help you somehow? i am very excited with splash and other fixes in new version, but can't move on because of this. i can give you even root access to all setup.

binux commented 7 years ago

I don't have any idea in mind currently, need to review the changes of scheduler first.

volvofixthis commented 7 years ago

Maybe this will help you, old docker image is laki9/pyspider:python3 , new laki9/pyspider:git_python3 Old image was created six month ago.

volvofixthis commented 7 years ago

checked which last commit was in old version here it is https://github.com/binux/pyspider/commit/0742654a7f9fd4606e946a2c4717f733b2707dd3

How do you think it will be hard to backport commits about phantomjs timeout and debug with lazy config to this version? https://github.com/binux/pyspider/commit/360f8698b59f68455252847ef318d8685dcf1146

binux commented 7 years ago

lazy config is not easy to backport, it related to deep changes to multiple components

binux commented 7 years ago

I found a potential bug that may block scheduler when one of the projects on_finished triggered when newtask_queue is full. Which can explain your case, I will fix that, but can't tell if it's the true issue here, you can try later.

volvofixthis commented 7 years ago

This can explain why there no any problems with low number of projects.

volvofixthis commented 7 years ago

nice job mate, it is working :+1: i will monitor it a little and close bug if all is ok.