访问AWS EC2实例上的其他驱动器?

我在Amazon EC2的Ubuntu实例上运行了一个应用程序,但内存不足。

这是df显示的内容:

ubuntu@ip-172-31-9-56:~/layers/punctuation$ df Filesystem 1K-blocks Used Available Use% Mounted on udev 16465276 0 16465276 0% /dev tmpfs 3294652 8808 3285844 1% /run /dev/xvda1 8065444 8049064 0 100% / tmpfs 16473244 0 16473244 0% /dev/shm tmpfs 5120 0 5120 0% /run/lock tmpfs 16473244 0 16473244 0% /sys/fs/cgroup tmpfs 3294652 0 3294652 0% /run/user/1000 

我的应用程序在/tmp文件夹中存储了很多大文件,所以我猜/tmp文件夹在/dev/xvda1

还有其他卷似乎有更多的空间。

  • 那些卷( tmpfsudev )是什么?
  • 我如何访问这些卷?

  • tmpfs是一个基于RAM的虚拟内存文件系统
  • udev使用虚拟文件提供动态设备管理

这些不使用实际磁盘,不能用于您的需要

注意:如果您想转换其他RAM并将其用作临时磁盘空间(AKA RAM DISK ),则可以使用以下命令执行此操作:

 $ sudo mount -t tmpfs -o size=10M tmpfs /mnt/mytmpfs 

虽然使用部分RAM作为RAM DISK可能会起作用,但它会占用RAM中分配为DISK的那部分内容,而您的程序将无法再将其用作RAM。

在分配RAM磁盘后,您需要确保有足够的RAM用于任务/处理

为了拥有更多的磁盘存储空间并且仍然能够将RAM用于您的程序需求 – 简单的解决方案是添加磁盘 /使用具有更大磁盘的其他计算机,或任何其他AWS解决方案,以便在您的计算机中使用额外的磁盘存储空间。


更多来自Ubuntu Man页面的信息:

男人tmpfs :

名称

  tmpfs - a virtual memory filesystem 

描述

  The tmpfs facility allows the creation of filesystems whose contents reside in virtual memory. Since the files on such filesystems typically reside in RAM, file access is extremely fast. The filesystem is automatically created when mounting a filesystem with the type tmpfs via a command such as the following: $ sudo mount -t tmpfs -o size=10M tmpfs /mnt/mytmpfs 

男人udev :

名称

  udev - Dynamic device management 

描述

  udev supplies the system software with device events, manages permissions of device nodes and may create additional symlinks in the /dev directory, or renames network interfaces. The kernel usually just assigns unpredictable device names based on the order of discovery. Meaningful symlinks or network device names provide a way to reliably identify devices based on their properties or current configuration.