AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 435618
Accepted
Jeevan Dongre
Jeevan Dongre
Asked: 2012-10-07 21:04:29 +0800 CST2012-10-07 21:04:29 +0800 CST 2012-10-07 21:04:29 +0800 CST

面向内存的进程和面向CPU的进程分离

  • 772

我是一家电子商务公司的开发人员,我正在运行我的电子商务应用程序,该应用程序是使用 ruby​​ on rails spree commerce 构建的。我目前正在生产中运行 2 个中型实例。一个是具有 3.8 RAM 和单核 CPU 的高内存实例,另一个是具有双核 CPU 的高 CPU 实例。基本上 AWS 称它分别有 m1.medium 和 c1.medium 实例。我的问题是可以根据 cpu 强度和内存强度来分离进程吗?这样所有 cpu 密集型进程都可以在高 cpu 实例中运行,所有内存密集型进程都可以在高内存实例中运行。是否有任何工具可用于识别这些过程。请给我一些提醒。谢谢

amazon-web-services
  • 1 1 个回答
  • 139 Views

1 个回答

  • Voted
  1. Best Answer
    Istvan
    2012-10-07T21:31:14+08:002012-10-07T21:31:14+08:00

    很难将这些东西正确地分开,通常一个 CPU 密集型任务和一个内存繁重的任务在同一个盒子上完全没问题。我想大多数时候 AWS 使用的公司可能会构建最统一的负载设备,因为您需要使用相对同质的硬件机群(很少有特殊情况(数据库服务器))。我宁愿尝试找出最便宜的实例,你可以运行你至少堆叠 2 次(但建议 3 次)。通过这种方式,您可以获得更高的可用性和更少的性能开销。您需要的工具是 ps on linux(以及其他一些操作系统)。

    中央处理器:

    ps -eo 'pcpu,%cpu,pid,comm' | grep -v '%CPU   PID COMMAND' | sort -n  
    

    内存:

    ps -eo 'rss,%mem,pcpu,%cpu,pid,comm' | grep -v '%CPU   PID COMMAND' | sort -n
    

    请查看联机帮助页的字段部分以获取更多信息:

           CODE        HEADER    DESCRIPTION
    
       %cpu        %CPU      cpu utilization of the process in "##.#" format. Currently, it is the CPU time used divided by the
                             time the process has been running (cputime/realtime ratio), expressed as a percentage. It will not add
                             up to 100% unless you are lucky. (alias pcpu).
    
       %mem        %MEM      ratio of the process's resident set size  to the physical memory on the machine, expressed as a
                             percentage. (alias pmem).
    
       args        COMMAND   command with all its arguments as a string. Modifications to the arguments may be shown. The output in
                             this column may contain spaces. A process marked <defunct> is partly dead, waiting to be fully
                             destroyed by its parent. Sometimes the process args will be unavailable; when this happens, ps will
                             instead print the executable name in brackets. (alias cmd, command). See also the comm format keyword,
                             the -f option, and the c option.
                             When specified last, this column will extend to the edge of the display. If ps can not determine
                             display width, as when output is redirected (piped) into a file or another command, the output width
                             is undefined (it may be 80, unlimited, determined by the TERM variable, and so on). The COLUMNS
                             environment variable or --cols option may be used to exactly determine the width in this case. The w
                             or -w option may be also be used to adjust width.
    
       blocked     BLOCKED   mask of the blocked signals, see signal(7). According to the width of the field, a 32 or 64-bit mask
                             in hexadecimal format is displayed. (alias sig_block, sigmask).
    
       bsdstart    START     time the command started. If the process was started less than 24 hours ago, the output format is
                             " HH:MM", else it is "Mmm dd" (where Mmm is the three letters of the month). See also lstart, start,
                             start_time, and stime.
    
    • 3

相关问题

  • AWS RDS 的定价 [关闭]

  • 如何在 AWS ubuntu 实例上安装 apache?

  • 了解 Amazon AWS 使用数据

  • 亚马逊提供的负载均衡服务体验如何?

  • ELB 中现有节点的 AWS 自动缩放问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve