strange effects whith network timeout

Support and queries relating to all previous versions of ZoneMinder
Locked
olaf
Posts: 5
Joined: Sun Jul 27, 2003 2:02 pm

strange effects whith network timeout

Post by olaf »

Hi!

Because of my problems with my AXIS Network Cam (see other thread) I tried to use an image from my local webserver as input ( I copied an image of the Axis cam to my htdocs folder).
The problem now is that I have to set the network timout to at least 30000 (msec), otherwise I get a message in my messages file saying "zmc ... Select timed out". I can only test this manually by starting zmc an than after more than 30 seconds using zmu -i to dump an image.
If I start the zm system from the webinterface the zmc thread gets restartet by the watchdog (zmwatch.pl) beacuse it isn't doing anything for more than 30 seconds.
So, why do I have to use such a high timeout??? The image that ist dumped by zmu is the correct image from my htdocs dirrctory. So everything is working fine, but extremely slow.

The commandline I use for zmc is:
./zmc -H 127.0.01 -P 80 -p '/image320x240.jpg'

The commandline I use for zmu is:
./zmu -Uadmin -Padmin -i

I use an SUSE 8.2 System.

Any idea???
Regards, Olaf.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: strange effects whith network timeout

Post by zoneminder »

Hi Olaf,

I wonder if what's happening here is that your first image is being loaded correctly and the following requests are all getting a different header from the web server as the image is the same.

I would suggest editing zmc.cpp and under the line

zm_dbg_name = "zmc";

add

zm_dbg_level = 3;

and then recompiling as a test binary. Then before you run it from the command line do

export ZM_DBG_PRINT = 1

and you will see all debug and erros come out on the console. The same effect of increasing the debug level can be achieved general by sending a USR1 signal to the binary (USR2 reduces the level) but in this case I doubt you'd have chance before the first request is sent.

Hopefully you'll see something that will give us the answer.

Cheers,

Phil,
olaf
Posts: 5
Joined: Sun Jul 27, 2003 2:02 pm

Re: strange effects whith network timeout

Post by olaf »

Hi!

Here is the debug output. BTW I already tried to activate debug by exporting ZM_DBG_LEVEL_zmc=3, but that did not work.

From the debug output you can see, that one cycle (from getting a picture to the next) is 17 seconds. But this varies from 10 to 17 seconds on different starts but stays the same when zmc is running.

Here we go:

oben:/home/marc/downloads/zm-0.9.15/src # ./zmc -H 127.0.0.1 -P 80 -p '/image320x240.jpg'
07/29/03 00:14:00.524277 zmc-h127.0.0.1[23874].INF-zm_debug.c/189 [Debug Level = 3, Debug Log = ]
07/29/03 00:14:00.530090 zmc-h127.0.0.1[23874].INF-zm_monitor.cpp/681 [Got 1 monitors]
07/29/03 00:14:00.533495 zmc-h127.0.0.1[23874].DB2-zm_remote_camera.cpp/102 [Request: GET /image320x240.jpg HTTP/1.0
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; Linux)/0.9.15
Connection: Keep-Alive

]
07/29/03 00:14:00.534111 zmc-h127.0.0.1[23874].INF-zm_monitor.cpp/83 [monitor mode=1]
07/29/03 00:14:00.534307 zmc-h127.0.0.1[23874].INF-zm_monitor.cpp/86 [shm.size=2304088]
07/29/03 00:14:00.538299 zmc-h127.0.0.1[23874].INF-zm_zone.cpp/47 [Initialised zone 0/All - 1 - 320x240 - Rgb:ff0000, AT:15, MnAP:50, MxAP:75000, FB:3x3, MnFP:50, MxFP:50000, MnBS:10, MxBS:0, MnB:0, MxB:0]
07/29/03 00:14:00.538872 zmc-h127.0.0.1[23874].INF-zm_monitor.cpp/141 [Monitor cam1 has function 2]
07/29/03 00:14:00.539078 zmc-h127.0.0.1[23874].INF-zm_monitor.cpp/142 [Monitor cam1 LBF = '%%s - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
07/29/03 00:14:00.539306 zmc-h127.0.0.1[23874].INF-zm_monitor.cpp/143 [Monitor cam1 IBC = 10, WUC = 25, pEC = 10, PEC = 10, FRI = 1000, RBP = 10]
07/29/03 00:14:00.540000 zmc-h127.0.0.1[23874].INF-zm_zone.cpp/412 [Got 1 zones for monitor cam1]
07/29/03 00:14:00.540399 zmc-h127.0.0.1[23874].INF-zm_zone.cpp/47 [Initialised zone 1/All - 1 - 320x240 - Rgb:ff0000, AT:25, MnAP:2304, MxAP:57600, FB:3x3, MnFP:2304, MxFP:57600, MnBS:1536, MxBS:0, MnB:1, MxB:0]
07/29/03 00:14:00.540688 zmc-h127.0.0.1[23874].INF-zm_monitor.cpp/690 [Loaded monitor 1(cam1), 1 zones]
07/29/03 00:14:00.540882 zmc-h127.0.0.1[23874].INF-zmc.cpp/156 [Starting Capture]
07/29/03 00:14:00.541307 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/128 [Connected to host, socket = 5]
07/29/03 00:14:00.547110 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/147 [Request sent]
07/29/03 00:14:00.547596 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/205 [Expecting 14711 bytes]
07/29/03 00:14:00.547852 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/234 [Read 14711 bytes of header/content]
07/29/03 00:14:00.548072 zmc-h127.0.0.1[23874].DB2-zm_remote_camera.cpp/246 [Header: HTTP/1.1 200 OK
Date: Mon, 28 Jul 2003 22:14:00 GMT
Server: Apache/1.3.27 (Linux/SuSE) PHP/4.3.1
Last-Modified: Sun, 27 Jul 2003 09:52:14 GMT
ETag: "36904-3846-3f23a0ce"
Accept-Ranges: bytes
Content-Length: 14406
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: image/jpeg
]
07/29/03 00:14:00.548638 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/277 [Excess length = 305]
07/29/03 00:14:00.548840 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/279 [Content length = 14406]
07/29/03 00:14:17.381981 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/205 [Expecting 0 bytes]
07/29/03 00:14:17.382056 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/209 [Socket closed]
07/29/03 00:14:17.387937 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/128 [Connected to host, socket = 5]
07/29/03 00:14:17.388034 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/147 [Request sent]
07/29/03 00:14:17.389282 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/205 [Expecting 14711 bytes]
07/29/03 00:14:17.389376 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/234 [Read 14711 bytes of header/content]
07/29/03 00:14:17.389400 zmc-h127.0.0.1[23874].DB2-zm_remote_camera.cpp/246 [Header: HTTP/1.1 200 OK
Date: Mon, 28 Jul 2003 22:14:17 GMT
Server: Apache/1.3.27 (Linux/SuSE) PHP/4.3.1
Last-Modified: Sun, 27 Jul 2003 09:52:14 GMT
ETag: "36904-3846-3f23a0ce"
Accept-Ranges: bytes
Content-Length: 14406
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: image/jpeg
]
07/29/03 00:14:17.389444 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/277 [Excess length = 305]
07/29/03 00:14:17.389465 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/279 [Content length = 14406]
07/29/03 00:14:34.381953 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/205 [Expecting 0 bytes]
07/29/03 00:14:34.382029 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/209 [Socket closed]
07/29/03 00:14:34.387759 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/128 [Connected to host, socket = 5]
07/29/03 00:14:34.387856 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/147 [Request sent]
07/29/03 00:14:34.389810 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/205 [Expecting 14711 bytes]
07/29/03 00:14:34.389906 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/234 [Read 14711 bytes of header/content]
07/29/03 00:14:34.389929 zmc-h127.0.0.1[23874].DB2-zm_remote_camera.cpp/246 [Header: HTTP/1.1 200 OK
Date: Mon, 28 Jul 2003 22:14:34 GMT
Server: Apache/1.3.27 (Linux/SuSE) PHP/4.3.1
Last-Modified: Sun, 27 Jul 2003 09:52:14 GMT
ETag: "36904-3846-3f23a0ce"
Accept-Ranges: bytes
Content-Length: 14406
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: image/jpeg
]
07/29/03 00:14:34.389975 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/277 [Excess length = 305]
07/29/03 00:14:34.389995 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/279 [Content length = 14406]
07/29/03 00:14:51.381988 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/205 [Expecting 0 bytes]
07/29/03 00:14:51.382064 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/209 [Socket closed]
07/29/03 00:14:51.387789 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/128 [Connected to host, socket = 5]
07/29/03 00:14:51.387884 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/147 [Request sent]
07/29/03 00:14:51.389200 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/205 [Expecting 14711 bytes]
07/29/03 00:14:51.389294 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/234 [Read 14711 bytes of header/content]
07/29/03 00:14:51.389319 zmc-h127.0.0.1[23874].DB2-zm_remote_camera.cpp/246 [Header: HTTP/1.1 200 OK
Date: Mon, 28 Jul 2003 22:14:51 GMT
Server: Apache/1.3.27 (Linux/SuSE) PHP/4.3.1
Last-Modified: Sun, 27 Jul 2003 09:52:14 GMT
ETag: "36904-3846-3f23a0ce"
Accept-Ranges: bytes
Content-Length: 14406
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: image/jpeg
]
07/29/03 00:14:51.389364 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/277 [Excess length = 305]
07/29/03 00:14:51.389385 zmc-h127.0.0.1[23874].DB3-zm_remote_camera.cpp/279 [Content length = 14406]
Locked