设备上没有剩余空间使用vps rails passenger + nginx

时间:2016-05-16 14:44:07

标签: ruby-on-rails nginx passenger vps inode

我在服务器vps上遇到空间问题,在带有乘客和nginx的生产环境中使用轨道上的应用程序。 我读了很多类似的问题,但没有找到我的解决方案。  我的错误可能是

bash: cannot create temp file for here-document: No space left on device

我的存储空间

admin@vps202702:~$ sudo du -h --max-depth=1 /
[sudo] password for admin: 
206M    /lib
12K /srv
12M /opt
4.0K    /mnt
12M /bin
14M /root
20M /boot
2.0G    /usr
6.4M    /sbin
6.7G    /var
4.0K    /lib64
16K /lost+found
0   /sys
933M    /home
5.3M    /run
24K /tmp
du: cannot access ‘/proc/23910/task/23910/fd/4’: No such file or directory
du: cannot access ‘/proc/23910/task/23910/fdinfo/4’: No such file or    directory
du: cannot access ‘/proc/23910/fd/4’: No such file or directory
du: cannot access ‘/proc/23910/fdinfo/4’: No such file or directory
0   /proc
0   /dev
4.0K    /media
7.8M    /etc
9.9G    /

详细存储空间

admin@vps202702:~$ sudo du -x / | sort -n | tail -40
120736  /var/www/plannings_ecranvillage/code/.git/objects/pack
121908  /home/admin/.rvm/gems/ruby-2.2.1/cache
128912  /usr/lib/locale
129972  /var/www/plannings_ecranvillage/code/.git/objects
132152  /var/www/plannings_ecranvillage/code/.git
165128  /lib/modules/3.16.0-4-amd64/kernel
168844  /lib/modules/3.16.0-4-amd64
168848  /lib/modules
184432  /usr/share/doc
185980  /usr/share/locale
204432  /usr/bin
208020  /var/www/plannings_ecranvillage/code/log
209936  /lib
225812  /var/www/plannings_ecranvillage/code/bundle/ruby/2.2.0/gems
234060  /var/www/plannings_ecranvillage/code/vendor/bundle/ruby/2.2.0/gems
293548  /var/lib
297180  /var/www/plannings_ecranvillage/code/bundle/ruby/2.2.0
297184  /var/www/plannings_ecranvillage/code/bundle/ruby
297188  /var/www/plannings_ecranvillage/code/bundle
306828  /var/www/plannings_ecranvillage/code/vendor/bundle/ruby/2.2.0
306832  /var/www/plannings_ecranvillage/code/vendor/bundle/ruby
306836  /var/www/plannings_ecranvillage/code/vendor/bundle
306852  /var/www/plannings_ecranvillage/code/vendor
444924  /usr/lib/x86_64-linux-gnu
562076  /home/admin/.rvm/gems/ruby-2.2.1/gems
771244  /home/admin/.rvm/gems/ruby-2.2.1
771252  /home/admin/.rvm/gems
842120  /usr/share
907040  /home/admin/.rvm
941852  /home/admin
946400  /usr/lib
954900  /home
956848  /var/www/plannings_ecranvillage/code
956876  /var/www/plannings_ecranvillage
956892  /var/www
2037752 /usr
5734208 /var/log/nginx
5735444 /var/log
7007748 /var
10282476    /

正在使用的节点

admin@vps202702:~$ df -i
Filesystem     Inodes  IUsed  IFree IUse% Mounted on
/dev/vda1      655360 151619 503741   24% /
udev           249112    295 248817    1% /dev
tmpfs          251192    355 250837    1% /run
tmpfs          251192      1 251191    1% /dev/shm
tmpfs          251192      3 251189    1% /run/lock
tmpfs          251192     13 251179    1% /sys/fs/cgroup
tmpfs          251192      4 251188    1% /run/user/1001

admin@vps202702:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       9.9G  9.9G     0 100% /
udev             10M     0   10M   0% /dev
tmpfs           393M  5.3M  388M   2% /run
tmpfs           982M     0  982M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           982M     0  982M   0% /sys/fs/cgroup
tmpfs           197M     0  197M   0% /run/user/1001

我在/ home / admin中创建了一个目录mytmp,并使用此行进行了编辑 /home/admin/.bashrc

 export TMPDIR=/home/admin/mytmp

我的磁盘不是那么大:

admin@vps202702:~$ sudo fdisk -l

Disk /dev/vda: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start      End  Sectors Size Id Type
/dev/vda1  *     2048 20971519 20969472  10G 83 Linux

插入inode

root@vps202702:~# for i in /*; do echo $i; find $i |wc -l; done
/bin
151
/boot
7
/dev
297
/etc
2162
/extlinux.conf 
1
/home
33553
/initrd.img
1
/ldlinux.c32
1
/ldlinux.sys
1
/lib
4597
/lib64
2
/lost+found
1
/media
1
/mnt
1
/opt
34
/proc
14853
/root
9
/run
360
/sbin
146
/srv
3
/sys
15871
/tmp
6
/usr
85647
/var 
25250
/vmlinuz
1

乘客版

Phusion Passenger 5.0.28

RVM版

admin@vps202702:~$ rvm -v
rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

尝试用这个技巧解决

admin@vps202702:~$ sudo -i 
root@vps202702:~# pushd /proc ; for i in [1-9]* ; do ls -l $i/fd | grep "(deleted)" && (echo -n "used by: " ; ps -p $i | grep -v PID ; echo ) ; done ; popd
/proc ~
~

我不确定,但我认为/ proc有问题吗? 怎么了?

0 个答案:

没有答案