Страница 3 из 18
Re: основной цикл системы
Добавлено: Чт окт 04, 2012 5:05 pm
resetnow
Есть одна маленькая деталь — после разбиения циклов на отдельные процессы возросло потребление памяти. Каждый цикл теперь потребляет около 10 мб. Как это исправить, пока не очень представляю, нашел вот это:
http://habrahabr.ru/post/40432/. Метод не работает в Windows, что, на мой взгляд, не так критично — на домашнем сервере, как правило, стоит linux. Как закончу с дисплеями, попробую как-то внедрить.
Re: основной цикл системы
Добавлено: Чт окт 04, 2012 5:23 pm
sergejey
resetnow писал(а):Есть одна маленькая деталь — после разбиения циклов на отдельные процессы возросло потребление памяти. Каждый цикл теперь потребляет около 10 мб. Как это исправить, пока не очень представляю, нашел вот это:
http://habrahabr.ru/post/40432/. Метод не работает в Windows, что, на мой взгляд, не так критично — на домашнем сервере, как правило, стоит linux. Как закончу с дисплеями, попробую как-то внедрить.
У меня уже была реализация через fork, но от неё как раз отказался из-за того, что обязательно Linux должен быть. Как вариант, сделать как-то универсально -- если Linux, то использовать fork, если Windows, то как сейчас. В принципе, 10Мб не так уж много, даже при 10 одновременных циклах.
Re: основной цикл системы
Добавлено: Чт окт 04, 2012 6:34 pm
resetnow
Так и надо. Уже сейчас для того, чтобы запускать в Linux, некоторые участки кода приходилось изменять и встраивать условие проверки ОС. Иначе, думаю, никак, отличий слишком много.
Re: основной цикл системы
Добавлено: Ср окт 17, 2012 10:57 am
Anton_kulibin
У меня при запуске основного цикла выдоет ошибку
Код: Выделить всё
17.10.2012 11:44:38
Starting ./scripts/cycle_scheduler.php ...
17.10.2012 11:44:38
Starting ./scripts/cycle_states.php ...
17.10.2012 11:44:38
Starting ./scripts/cycle_webvars.php ...
17.10.2012 11:44:38
Starting ./scripts/cycle_watchfolders.php ...
17.10.2012 11:44:38
Starting ./scripts/cycle_rss.php ...
17.10.2012 11:44:38
Starting ./scripts/cycle_onewire.php ...
17.10.2012 11:44:38
Starting ./scripts/cycle_execs.php ...
17.10.2012 11:44:38
Starting ./scripts/cycle_ping.php ...
17.10.2012 11:44:38
Starting ./scripts/cycle_onewire_starred.php ...
17.10.2012 11:44:38
Starting ./scripts/cycle_main.php ...
17.10.2012 11:44:39
Cycle running OK: cycle_execs.php
17.10.2012 11:44:39
Cycle running OK: cycle_onewire_starred.php
17.10.2012 11:44:39
Cycle running OK: cycle_states.php
17.10.2012 11:44:39
Cycle running OK: cycle_onewire.php
17.10.2012 11:44:39
Cycle running OK: cycle_scheduler.php
17.10.2012 11:44:39
Cycle running OK: cycle_ping.php
17.10.2012 11:44:39
Cycle running OK: cycle_webvars.php
17.10.2012 11:44:39
Cycle running OK: cycle_rss.php
17.10.2012 11:44:39
Cycle running OK: cycle_main.php
17.10.2012 11:44:39
Cycle running OK: cycle_watchfolders.php
17.10.2012 11:44:46
Oct 17, 2012 11:44:46 http://
Error:
1054: Unknown column 'TITLE' in 'field list'<br>SELECT ID, TITLE FROM owdisplays WHERE 1 AND UPDATE_NEXT<='1350459886' ORDER BY UPDATE_NEXT
17.10.2012 11:44:46
Closing thread: php -q ./scripts/cycle_onewire.php --params "a:0:{}"
17.10.2012 11:52:04
JAVASCRIPT Error: URL: http://mynet.myftp.org/menu.html - Uncaught TypeError: Cannot set property 'innerHTML' of null; line: 5
17.10.2012 11:52:09
JAVASCRIPT Error: URL: http://mynet.myftp.org/menu.html - Uncaught TypeError: Cannot set property 'innerHTML' of null; line: 5
Re: основной цикл системы
Добавлено: Ср окт 17, 2012 11:41 am
sergejey
1054: Unknown column 'TITLE' in 'field list'<br>SELECT ID, TITLE FROM owdisplays WHERE 1 AND UPDATE_NEXT<='1350459886' ORDER BY UPDATE_NEXT
Исправил. Не хватало одного поля в таблице owdisplays
Re: основной цикл системы
Добавлено: Ср окт 17, 2012 7:56 pm
Anton_kulibin
вроде еще баг, не мог выследить переменную
Код: Выделить всё
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:52 running cycle_main.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:52 running cycle_rss.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:52 running cycle_onewire_starred.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:52 running cycle_onewire.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:52 running cycle_watchfolders.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:52 running cycle_webvars.php
20:54:52 running cycle_ping.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:53 running cycle_scheduler.php
20:54:53 running cycle_states.php
20:54:53 running cycle_execs.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:53 running cycle_main.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:53 running cycle_rss.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:53 running cycle_onewire_starred.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:53 running cycle_onewire.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
Checking device: Ulica
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:53 running cycle_watchfolders.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:53 running cycle_webvars.php
20:54:53 running cycle_ping.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:54 running cycle_scheduler.php
20:54:54 running cycle_execs.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:54 running cycle_states.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:54 running cycle_main.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:54 running cycle_rss.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:54 running cycle_onewire_starred.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:54 running cycle_watchfolders.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:54 running cycle_webvars.php
20:54:54 running cycle_ping.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:55 running cycle_scheduler.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:55 running cycle_states.php
20:54:55 running cycle_execs.php
PHP Notice: Undefined variable: results in /media/data/public_html/lib/threads.php on line 83
20:54:55 running cycle_main.php
Re: основной цикл системы
Добавлено: Ср окт 17, 2012 8:06 pm
sergejey
это не ошибка, а "уведомление". оно на работу не влияет и я бы эти уведомления вовсе отключил в настройках php.ini
Re: основной цикл системы
Добавлено: Вт окт 23, 2012 4:00 am
zverev.sv
Сергей здравствуйте, подскажите пожалуйста!
В чем проблема?
Установил на Ubuntu 12.04, при запуске /var/www/cycle.php выдает вот такие ошибки:
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/mysql.class.php on line 397
CONNECTED TO DB
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/modules/control_modules/control_modules.class.php on line 134
Running startup maintenance
admin_users ...OK
btdevices ...OK
calendar_categories ...OK
calendar_events ...OK
classes ...OK
collections ...OK
commands ...OK
elements ...OK
elm_states ...OK
events ...OK
gpsactions ...OK
gpsdevices ...OK
gpslocations ...OK
gpslog ...OK
history ...OK
jobs ...OK
layouts ...OK
locations ...OK
media_favorites ...OK
methods ...OK
newsletter ...OK
objects ...OK
owdevices ...OK
owdisplays ...OK
owproperties ...OK
patterns ...OK
phistory ...OK
pinghosts ...OK
prod_categories ...OK
product_categories ...OK
product_codes ...OK
product_log ...OK
products ...OK
project_modules ...OK
properties ...OK
pvalues ...OK
rss_channels ...OK
rss_items ...OK
safe_execs ...OK
scenes ...OK
script_categories ...OK
scripts ...OK
settings ...OK
shoplist ...OK
shopping_list_items ...OK
shoutrooms ...OK
shouts ...OK
tdwiki ...OK
terminals ...OK
usbdevices ...OK
userlog ...OK
users ...OK
watchfolders ...OK
webvars ...OK
Starting ./scripts/cycle_rss.php ... OK
Starting ./scripts/cycle_states.php ... OK
Starting ./scripts/cycle_scheduler.php ... OK
Starting ./scripts/cycle_execs.php ... OK
Starting ./scripts/cycle_onewire_starred.php ... OK
Starting ./scripts/cycle_onewire.php ... OK
Starting ./scripts/cycle_watchfolders.php ... OK
Starting ./scripts/cycle_main.php ... OK
Starting ./scripts/cycle_ping.php ... OK
Starting ./scripts/cycle_webvars.php ... OK
ALL CYCLES STARTED
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/mysql.class.php on line 397
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/mysql.class.php on line 397
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/mysql.class.php on line 397
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/mysql.class.php on line 397
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/mysql.class.php on line 397
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/xml.class.php on line 54
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/mysql.class.php on line 397
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/mysql.class.php on line 397
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/modules/control_modules/control_modules.class.php on line 134
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/modules/control_modules/control_modules.class.php on line 134
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/modules/control_modules/control_modules.class.php on line 134
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/mysql.class.php on line 397
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/modules/control_modules/control_modules.class.php on line 134
11:53:27 running cycle_main.php
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/mysql.class.php on line 397
11:53:27 running cycle_states.php
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/lib/mysql.class.php on line 397
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/modules/control_modules/control_modules.class.php on line 134
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/modules/control_modules/control_modules.class.php on line 134
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/modules/control_modules/control_modules.class.php on line 134
11:53:27 running cycle_onewire.php
11:53:27 running cycle_execs.php
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/modules/control_modules/control_modules.class.php on line 134
11:53:27 running cycle_onewire_starred.php
11:53:27 running cycle_ping.php
11:53:27 running cycle_rss.php
11:53:27 running cycle_webvars.php
Checking device: Rele_2_Test
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/modules/control_modules/control_modules.class.php on line 134
11:53:28 running cycle_watchfolders.php
Checking device: Master
PHP Deprecated: Call-time pass-by-reference has been deprecated in /var/www/modules/control_modules/control_modules.class.php on line 134
11:53:28 running cycle_scheduler.php
11:53:28 running cycle_main.php
11:53:28 running cycle_states.php
11:53:28 running cycle_execs.php
11:53:28 running cycle_ping.php
11:53:28 running cycle_rss.php
Checking device: Rele_Lighting_8
Checking device: Sensor_Motion_
Checking device: Sensor_Water_Leakage
Checking device: Sensor_Humidity_Temperature_Light
11:53:29 running cycle_watchfolders.php
Checking device: Sensor_Voltage
Checking device: Sensor_Temp_Test
11:53:29 running cycle_webvars.php
11:53:29 running cycle_scheduler.php
11:53:29 running cycle_main.php
11:53:29 running cycle_states.php
11:53:29 running cycle_execs.php
11:53:29 running cycle_ping.php
11:53:29 running cycle_rss.php
11:53:29 running cycle_onewire_starred.php
11:53:30 running cycle_watchfolders.php
11:53:30 running cycle_webvars.php
11:53:30 running cycle_scheduler.php
11:53:30 running cycle_onewire.php
Checking device: Rele_2_Test
Checking device: Sensor_Motion_
Checking device: Master
Checking device: Rele_Lighting_8
Checking device: Sensor_Water_Leakage
Checking device: Sensor_Humidity_Temperature_Light
Checking device: Sensor_Voltage
11:53:30 running cycle_main.php
11:53:30 running cycle_states.php
11:53:30 running cycle_execs.php
11:53:30 running cycle_ping.php
11:53:30 running cycle_rss.php
11:53:30 running cycle_onewire_starred.php
11:53:31 running cycle_watchfolders.php
11:53:31 running cycle_webvars.php
11:53:31 running cycle_scheduler.php
11:53:31 running cycle_onewire.php
Checking device: Sensor_Motion_
Checking device: Sensor_Water_Leakage
Checking device: Sensor_Humidity_Temperature_Light
Checking device: Sensor_Voltage
Checking device: Rele_2_Test
Checking device: Master
Checking device: Rele_Lighting_8
11:53:31 running cycle_main.php
11:53:31 running cycle_states.php
11:53:31 running cycle_execs.php
11:53:31 running cycle_ping.php
11:53:31 running cycle_rss.php
11:53:31 running cycle_onewire_starred.php
11:53:32 running cycle_watchfolders.php
11:53:32 running cycle_webvars.php
11:53:32 running cycle_scheduler.php
11:53:32 running cycle_onewire.php
Checking device: Sensor_Motion_
11:53:32 running cycle_main.php
Checking device: Sensor_Water_Leakage
11:53:32 running cycle_states.php
Checking device: Sensor_Humidity_Temperature_Light
Checking device: Sensor_Voltage
11:53:32 running cycle_execs.php
Checking device: Rele_2_Test
Checking device: Master
11:53:32 running cycle_ping.php
11:53:32 running cycle_rss.php
Checking device: Rele_Lighting_8
11:53:32 running cycle_onewire_starred.php
11:53:33 running cycle_watchfolders.php
11:53:33 running cycle_webvars.php
11:53:33 running cycle_scheduler.php
11:53:33 running cycle_main.php
11:53:33 running cycle_states.php
11:53:33 running cycle_execs.php
11:53:33 running cycle_ping.php
11:53:33 running cycle_rss.php
11:53:33 running cycle_onewire_starred.php
11:53:33 running cycle_onewire.php
Checking device: Sensor_Motion_
Checking device: Sensor_Water_Leakage
Checking device: Sensor_Humidity_Temperature_Light
Checking device: Sensor_Voltage
Checking device: Rele_2_Test
11:53:34 running cycle_watchfolders.php
Checking device: Master
Checking device: Rele_Lighting_8
11:53:34 running cycle_webvars.php
11:53:34 running cycle_scheduler.php
11:53:34 running cycle_main.php
11:53:34 running cycle_states.php
11:53:34 running cycle_execs.php
11:53:34 running cycle_ping.php
11:53:34 running cycle_rss.php
11:53:34 running cycle_onewire_starred.php
11:53:35 running cycle_watchfolders.php
11:53:35 running cycle_webvars.php
11:53:35 running cycle_onewire.php
Checking device: Sensor_Motion_
11:53:35 running cycle_scheduler.php
Checking device: Sensor_Water_Leakage
Checking device: Sensor_Humidity_Temperature_Light
Checking device: Sensor_Voltage
Заранее спасибо!!!
Re: основной цикл системы
Добавлено: Пн дек 17, 2012 11:57 am
Athom
Добрый день!
Подскажите, не заметил когда, но перестало выполняться событие "onNewMinute"
Нашел в cycle_main.php строки ответственные за это:
for($i=0;$i<$total;$i++) {
echo $objects[$i]['TITLE']."->onNewMinute\n";
getObject($objects[$i]['TITLE'])->raiseEvent("onNewMinute");
getObject($objects[$i]['TITLE'])->setProperty("time", date('Y-m-d H:i:s'));
}
Смотрю через "рентген": onNewMinute не выполняется, а время обновляется исправно каждую минуту.
Вывод скрипта:
10:56:00 running cycle_main.php
new minute
ClockChime->onNewMinute
10:56:01 running cycle_main.php
Подскажите, пожалуйста, в какую сторону копнуть?
Re: основной цикл системы
Добавлено: Пн дек 17, 2012 2:18 pm
raptorialfungus
Athom писал(а):
Смотрю через "рентген": onNewMinute не выполняется, а время обновляется исправно каждую минуту.
Вывод скрипта:
10:56:00 running cycle_main.php
new minute
ClockChime->onNewMinute
10:56:01 running cycle_main.php
Подскажите, пожалуйста, в какую сторону копнуть?
Тут я описывал точно такую же ситуацию у меня:
http://smartliving.ru/forum/viewtopic.p ... =386#p1953
Решение
Curl'у мешают несколько параметров. А именно
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 500);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 500);
в функции raiseEvent в /modules/objects/objects.class.php. Я эти строки пока закомментировал.