Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have to run a large amount of procceses sshpass with php in screen (over 5000) and after 1000

I observed that the system is very slow and won't continue executing the whole process. I debugged a little (with screen -x NAME_OF_THAT_SCREEN), and i saw that at some point, inside that screens start printing this error :

Failed to get a pseudo terminal: No space left on device

meaning that i don't have space on the hardisk, but in fact i do have, and inodes values are quite normal

DEBUG METHOD 1

root@server1:~# df -ahk
Filesystem      1K-blocks    Used  Available Use% Mounted on
rootfs           20511292 4269244   15193476  22% /
/dev/root        20511292 4269244   15193476  22% /
devtmpfs          8163120       4    8163116   1% /dev
none                    0       0          0    - /dev/pts
none                    0       0          0    - /proc
none                    0       0          0    - /sys
none                    0       0          0    - /proc/sys/fs/binfmt_misc
none                    0       0          0    - /sys/fs/fuse/connections
none                    0       0          0    - /sys/kernel/security
none              1632708    2800    1629908   1% /run
none                 5120       0       5120   0% /run/lock
none              8163536       0    8163536   0% /run/shm
overflow             1024      16       1008   2% /tmp
/dev/md2       1901565020   69096 1804895300   1% /home

DEBUG METHOD 2

I tought that this may happen due the fact that they are so many processes the pid_max value is to small and can't handle, and i runned this command

echo 4194303 > /proc/sys/kernel/pid_max

The processes are like

screen -AmdS open_server php open_server.php 123

that emulates threads and open a 1000 to 5000 of more screen-threads like :

screen -AmdS thread_open_port php open_port_by_id.php 123

EDIT1 :

when i open the server, i observe that top shows me a busy server

top - 17:12:05 up 7 days,  6:18,  8 users,  load average: 14.03, 5.26, 7.26
Tasks: 3053 total,  22 running, 2974 sleeping,  14 stopped,  43 zombie
Cpu(s): 60.6%us, 37.1%sy,  0.0%ni,  1.2%id,  0.6%wa,  0.0%hi,  0.5%si,  0.0%st
Mem:  16327072k total,  5448160k used, 10878912k free,   234720k buffers
Swap:  1050616k total,        0k used,  1050616k free,  2066904k cached

    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
   6272 mysql     20   0 2585m 207m 8316 S    6  1.3 112:55.55 mysqld
 396713 root      20   0 25724 1284 1052 R    3  0.0   0:00.10 ps
 396804 root      20   0 25724 1288 1052 R    3  0.0   0:00.10 ps
 396811 root      20   0 25724 1284 1052 R    3  0.0   0:00.10 ps
 396817 root      20   0 25724 1288 1052 R    3  0.0   0:00.10 ps
 396849 root      20   0 25724 1284 1052 R    2  0.0   0:00.07 ps
 396861 root      20   0 25724 1288 1052 R    2  0.0   0:00.07 ps
 395252 root      20   0 41532 2808 2164 S    2  0.0   0:00.06 ssh
 395306 root      20   0 41532 2808 2164 S    2  0.0   0:00.06 ssh
 395349 root      20   0 41532 2808 2168 S    2  0.0   0:00.06 ssh
 395364 root      20   0 41532 2804 2164 S    2  0.0   0:00.06 ssh
 395478 root      20   0 41532 2804 2164 S    2  0.0   0:00.06 ssh
 395548 root      20   0 41532 2808 2164 S    2  0.0   0:00.06 ssh
 395615 root      20   0 47736 3176 2492 S    2  0.0   0:00.06 ssh
 395684 root      20   0 41532 2808 2164 S    2  0.0   0:00.06 ssh
 395689 root      20   0 41532 2808 2164 S    2  0.0   0:00.06 ssh
  1. Why i get this error?
  2. Why this script is consuming that much? This dedicated server have a i5 processor at 16 gb RAM, witch is way too much for what i need (i think).

Thanks.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.