Sponsored Content
Special Forums UNIX and Linux Applications Apache+Perl: interruption of STDIN Post 302361373 by sevmax on Tuesday 13th of October 2009 04:42:39 AM
Old 10-13-2009
Question Apache+Perl: interruption of STDIN

Hello dear community!
I have faced with a trouble which I trying to solve for a long time.

I have service of video streaming. And I have web and video roles for servers.
Video servers upload video using SWFUpload and then stream it.
Issue became during uploading of video.
In random time users receive "I/O error", and I have record in database about this failure.
Also I am unable to repeat this error because don't know reasons.

Below are details of system:
CentOS 5 x86_64
Apache
Arch : x86_64
Version: 2.2.3
Release: 11.el5_2.centos.4

Perl
Arch : i386
Version: 5.8.8
Release: 15.el5_2.1

Below is answer I've receive on the same question from SWFUpload forum:
Quote:
There are a few common causes for IO errors. Unfortunately the Flash Player doesn't give any details.

The only way I can think of to log the details is to handle the uploadError event and send the "message" parameter to the server as an ajax request.

Whatever is shown in the message parameter is all the information that Flash gives us.

Most often IO errors are seen:
1. The POST (file size + other post paramters) exceeds the max allowed by the server.
2. The server script execution time exceeds the timeout limit
3. mod_security rejects the upload (because the Flash Player uses a valid but suspicious format for the upload)
4. An error in the page terminates the connection without a response
5. Some other timeout.
6. Anti-virus software.
I don't have #3 mod_security and #6 Anti-virus software on servers.

Is there any way to set timeouts for perl like for php in php.ini?

For Apache there are these settings for timeout:
Timeout 3000
KeepAliveTimeout 1500

Seems it would be enough. Is there any other timeout settings I could set for perl scripts?

Also, I'm using prefork MPM. If I change it for worker MPM could it help someway?

Help please to find the reason of errors.
I'll write any additional details which need to do progress.

Regards,
Maxim
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Apache Perl/CGI

Can any body help me with apache and cgi i'dont know how iconfigure apache to use cgi... and when i try to start apachectl it says there is no file... please help me...i have apache installed... (1 Reply)
Discussion started by: CreamHarry
1 Replies

2. Web Development

php and perl on apache server

I'm having problems opening php and perl files on Apache. The server hasn't any association with those type of files by default and a window asking to choose a program to open them popups from the browser. How can I do to process them with the browser Thanks in advance. (1 Reply)
Discussion started by: capibolso
1 Replies

3. Programming

Wireless C program conncection interruption problem

Dear Gurus My company has a wireless handheld C program as text-mode workstations in remote sites. We suspected that the program get interrupted sometimes because of out-of-wireless access and hence resulted in db record locking and other issue. It did trouble us a lot. Is it possible to use... (2 Replies)
Discussion started by: charles_chu
2 Replies

4. UNIX for Advanced & Expert Users

Apache module & perl problem

I have a very strange problem that I can't seem to solve. I have apache module which filters content and within that module I will add some more content based on this calls: int check; check = system("/usr/bin/check"); check is a perl-script that exits with value 1 if the file doesn't... (2 Replies)
Discussion started by: hjalle
2 Replies

5. Red Hat

util-linux upgrade with interruption?

Hi All, I have util-linux upgrade that I need to do on redhat 4 ent. Does this going to interruption with the operation of the OS or application? Or this will be straight forward upgrade that will not make a harm or downtime of the OS. Thank you for any comments you may add. (3 Replies)
Discussion started by: itik
3 Replies

6. Shell Programming and Scripting

STDIN-perl

Good morning! How do I make the info that someone inputs from @userArray = <STDIN>, a new array? @userArray = <STDIN>; while () { chomp; last if ! /\d/; push(@userArray,$_); } my($sum,$avg) = &sumIt(@userArray); print "Total:$sum\nAverage:$avg\n"; Im... (2 Replies)
Discussion started by: bigben1220
2 Replies

7. Shell Programming and Scripting

ssh connection through shell script with no interruption

Hi all, I need ssh in shell script. My requirement is: - Take user_name and password from user (in PHP) - Pass this to shell script which will: - connect via ssh - Run sql query - Pass the results back in PHP - Put the results to website. I know PHP has libraries for ssh and ftp, but... (3 Replies)
Discussion started by: shekhar2010us
3 Replies

8. Shell Programming and Scripting

How to run the script with out any interruption ?

Hi , Loggin to another host using the below command in my shell script ssh-keygen > /dev/null ssh-copy-id -i ~/.ssh/id_rsa.pub My problem is , the second commmand expecting a user input Eg : Press Enter for below three questions and issue your password Enter file... (9 Replies)
Discussion started by: arukuku
9 Replies

9. AIX

ssh interruption after aix os upgrade

Hi Through nimadm (alt_disk_install) we done aix os upgrade in 3 lpars from aix 5.3 to aix 6.1. upgrade was successful. After the upgrade users complained on their ssh keys. Does upgrading aix version affects the user's ssh keys ? If so please suggest on options to correct them. (1 Reply)
Discussion started by: newtoaixos
1 Replies

10. Programming

Simple capturing of keyboard input without interruption

I would like to make a function or command that checks for keyboard input without interrupting the program and exits the program when a key is pressed (perhaps the 'q' key). The program below monitors and prints/executes commands upon a change in primary (mouse selection) or clipboard buffer. If... (4 Replies)
Discussion started by: bedtime
4 Replies
VIDEO(4)						   BSD Kernel Interfaces Manual 						  VIDEO(4)

NAME
video -- device-independent video driver layer SYNOPSIS
#include <sys/videoio.h> DESCRIPTION
The video driver provides support for various video peripherals. It provides a uniform programming interface layer above different underly- ing video hardware drivers. The video layer provides a Video4Linux2 compatible API. A number of ioctl(2) commands are supported controlling the device. See http://v4l2spec.bytesex.org/ for the official V4L2 specification. The device file for video operation is /dev/video. READING VIDEO SAMPLES
Video data is separated into logical video samples which will typically be one complete video frame. With compressed formats, a video sample may be one logical chunk and not one complete frame depending on the compression format. Video samples may be read from /dev/video in one of several different modes. In read mode, calls to read(2) will return at most the data of one video sample. If the entire sample is not read, then subsequent reads will return at most the remaining data in that video sample. Video samples may be mapped into memory with mmap(2). The driver allocates internal buffers for a number of video samples which are mapped into memory. Initiating this mode requires several ioctl(2) commands: VIDIOC_REQBUFS to request the driver reserve buffers, VIDIOC_QUERYBUF to query the details of each buffer, mmap(2) to map each buffer into memory, VIDIOC_QBUF to queue the buffers for receiving video data, VIDIOC_STREAMON to begin streaming of video data, and VIDIOC_DQBUF to remove a filled buffer from the queue. At this point the video data from the dequeued buffer is valid. DEVICE CAPABILITIES
VIDIOC_QUERYCAP (struct v4l2_capability) This command queries the capabilities of the device. The first three fields are informational NULL terminated strings filled by the driver: driver describes the driver used by this device, card describes the video capture card or camera, and buf_info represents the bus to which the hardware device is attached. The capabilities field contains a number of flags indicating various features supported by the driver or hardware: V4L2_CAP_VIDEO_CAPTURE support video capturing V4L2_CAP_READWRITE supports the read(2) and/or write(2) mode V4L2_CAP_STREAMING supports mmap(2) mode struct v4l2_capability { uint8_t driver[16]; uint8_t card[32]; uint8_t bus_info[32]; uint32_t version; uint32_t capabilities; uint32_t reserved[4]; }; STREAMING INTERFACE
VIDIOC_REQBUFS (struct v4l2_requestbuffers) This command requests that the driver reserve space for count samples. type must be set to V4L2_BUF_TYPE_VIDEO_CAPTURE and memory to V4L2_MEMORY_MMAP. The returned count represents the actual number of samples reserved which may be more or fewer than requested. struct v4l2_requestbuffers { uint32_t count; enum v4l2_buf_type type; enum v4l2_memory memory; uint32_t reserved[2]; }; VIDIOC_QUERYBUF (struct v4l2_buffer) This command should be called for each buffer in count above. The fields index, type, and memory must be set to a valid index from 0 to count-1, and the same type and memory as used in VIDIOC_QUERYBUF. The driver returns m.offset and length. struct v4l2_buffer { uint32_t index; enum v4l2_buf_type type; uint32_t bytesused; uint32_t flags; enum v4l2_field field; struct timeval timestamp; struct v4l2_timecode timecode; uint32_t sequence; enum v4l2_memory memory; union { uint32_t offset; unsigned long userptr; } m; uint32_t length; uint32_t input; uint32_t reserved; }; mmap(2) Each buffer must be mapped with a call to mmap(2), passing the length and m.offset values obtained above. The prot PROT_READ|PROT_WRITE and flags MAP_SHARED are recommended. VIDIOC_QBUF (struct v4l2_buffer) This command indicates to the driver that the buffer is ready to receive a video sample. The following fields must be set: index, set to a valid buffer index from 0 to count - 1; type, set to the same type used above; and memory, set to the same memory used above. Each buffer should be queued with this command. Order is not important. VIDIOC_STREAMON (int) This command starts streaming. Queued buffers will be filled with data. select(2) will indicate that a buffer is done and available for reading. VIDIOC_DQBUF (struct v4l2_buffer) This command dequeues an available buffer from the driver. If no buffer is available, it blocks until one is, unless O_NONBLOCK was specified to open(2), in which case it returns EAGAIN. select(2), or poll(2) prior to initiating any other mode will begin streaming of video for reading with read(2). In this streaming mode select(2) or poll(2) indicate the availability of a video frame. Calls to read(2) will return at most the video data of one video sample. If the entire sample is not read, then subsequent reads will return at most the remaining data in that video sample. FILES
/dev/video SEE ALSO
auvitek(4), pseye(4), uvideo(4), video(9) HISTORY
The video device driver first appeared in NetBSD 5.0. AUTHORS
Patrick Mahoney <pat@polycrystal.org> BUGS
Does not support the complete V4L2 API. Only supports the capture interface. Does not support writing, overlay, VBI, tuner, audio, radio, or asyncio. BSD
March 5, 2011 BSD
All times are GMT -4. The time now is 06:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy