Chào mừng bạn đến với Diễn Đàn Máy Chủ - Chia sẽ kiến thức máy chủ.
  • Đăng ký
    • Login:
    Server Dell email 247 Tên miền Hosting giá sốc Tang loa Frei Tang loa Frei Tên miền tiếng việt giá bèo cdn rẻ vô địch May Chu Khong Lo - Gia Xi Trum SSL 2 nam giam 15%
    + Trả lời bài viết
    Hiện kết quả từ 1 tới 4 của 4
    1. #1
      Advisors
      Tham gia ngày
      Aug 2009
      Đến từ
      Nha Trang
      Bài gửi
      1.287

      Mặc định Cloud Linux manage by command !

      LVE is a kernel level technology developed by the CloudLinux team. The technology has common roots with container based virtualization and uses cgroups in its latest incarnation. It is lightweight, and transparent. The goal of LVE is to make sure that no single web site can bring down your web server.
      Today, a single site can consume all CPU, IO, Memory resources or apache processes -- and bring the server to a halt. LVE prevents that. It is done via collaboration of apache module, PAM module and kernel.

      mod_hostinglimits is apache module that:
      • Detects VirtualHost from which the request came.
      • Detects if it was meant for cgi or PHP script.
      • Puts apache process used to serve that request into LVE for the user determined via SuexecUserGroup directive for that virtual host.
      • Lets apache to serve the request.
      • Removes apache process from user's LVE.

      The kernel makes sure that all LVEs get fair share of the server's resources, and that no customer can use more then the limits set for that customer.
      Today we can limit CPU, Memory (virtual and physical), IO, number of processes as well as number of entry processes (concurrent connections to apache).

      Each LVE limits amount of entry processes (Apache processes entering into LVE) to prevent single site exhausting all Apache processes. If the limit is reached -- mod_hostinglimits will not be able to place Apache process into LVE, and will return error code 508. This way very heavy site would slow down and start returning 508 errors, without affecting other users.

      If the site is limited by CPU or IO -- the site will start responding slower.
      If the site is limited by memory or number of processes limits -- user will be 500 or 503 errors that server cannot execute the script

      Checking if LVE is installed
      To use LVE you have to have CloudLinux kernel installed, and LVE module loaded
      you can check the kernel by running the following command:
      $ uname -r

      You should see something like 2.6.18-294.8.1.el5.lve0.8.60. The kernel should have lve in its name. To see if lve kernel module is loaded do

      $ lsmod|grep lve
      lve 46496 0

      To see if iolimits module is enabled (el6.lve1.1.9 kernels and later):
      $ lsmod|grep iolimits
      iolimits

      You can toggle LVE on/ff by editing
      /etc/sysconfig/lve and setting LVE_ENABLE variable to yes or no.
      Setting it to yes will enable LVE, setting it to no will disable LVE.

      You can toggle IO limits by editing
      /etc/sysconfig/iolimits and setting IO_LIMITS_ENABLED variable to yes or no.
      You need to reboot the server, after you set this option to make the changes live

      Controlling LVE Limits
      The best way to control LVE limits is using LVE Manager in your favorite control panel. Alternatively, you can use command line tool lvectl to control limits.
      The limits are saved in /etc/container/ve.cfg

      Example:
      <?xml version="1.0" ?>
      <lveconfig>
      <defaults>
      <cpu limit="25"/>
      <ncpu limit="1"/>
      <io limit="1024"/>
      <mem limit="262144"/>
      <other maxentryprocs="200"/>
      <pmem limit="262144"/>
      <nproc limit="0"/>
      </defaults>
      <lve id="532">
      <cpu limit="30"/>
      <ncpu limit="5"/>
      </lve>
      </lveconfig>

      Sets CPU limit to 25%, IO limit to 1024KB/s, virtual memory limit to 1GB (memory limit is set as a number of 4096 bytes pages), physical memory limit to 1GB, CPU cores per LVE to 1, maximum entry processes to 200 and no limit for number of processes for all LVEs. It also sets the limit of 30% and number of processes limit to 5 for LVE with ID 532


      Checking LVE Usage
      One of the best way to monitor current usage is lvetop

      $ lvetop
      ID EP PNO TNO CPU MEM I/O
      test 1 2 2 2% 728 0


      You can also check the content of /proc/lve/list file that has all the data about LVE usage for all LVEs
      [root@localhost tests]$ cat /proc/lve/list
      4:LVE EP lCPU lIO CPU MEM IO lMEM lEP nCPU fMEM fEP
      0 0 75 25 0 0 0 262144 20 2 0 0
      500 0 75 25 0 0 0 4294967 20 3 2 1
      700 1 75 25 1403247 202 0 262144 20 2 0 0
      Additionally you can use tool lveps to see CPU usage, and processes within LVE

      tham khảo thêm

      http://docs.cloudlinux.com/
      Lần sửa cuối bởi vô danh; 19-04-2013 lúc 03:42 PM
      Chấp Nhận Thua 1 Trận Chiến Nhưng Sẽ Thắng Cả Cuộc Chiến .

    2. #2
      Advisors
      Tham gia ngày
      Aug 2009
      Đến từ
      Nha Trang
      Bài gửi
      1.287

      Mặc định

      lvectl

      lvectl is the primary tool for LVE management. To use it, you have to be administrator. lvectl is part of lve-utils package. The syntax of lvectl is:

      Usage: lvectl command [veid] [options]
      commands:
      apply apply config settings to specified VE
      apply all apply config settings to all the VEs
      apply-many to apply LVE limits to multiple distinct LVEs (uids of users are read from stdin)
      set set parameters for a VE and/or create a VE
      list list loaded VEs
      limits show limits for loaded VEs
      delete delete VE and set configuration for that VE to defaults
      destroy destroy VE (configuration file remains unchanged)
      destroy all destroy all VE (configuration file remains unchanged)
      destroy-many to destroy LVE limits to multiple distinct LVEs (uids of users are read from stdin)
      package-set set LVE parameters for a package
      package-list list LVE parameters for packages
      package-delete delete LVE parameters for a package
      paneluserslimits show current user's limits for control panel
      help (-h) show this message
      version (-v) version number
      lve-version lve version number
      options:
      --cpu=N limit CPU usage
      --ncpu=N limit VCPU usage
      --io=N define io limit, in KB/s
      --nproc=N limit number of processes
      --pmem=N limit physical memory usage for applications inside LVE
      --vmem=N limit virtual memory for applications inside LVE
      --maxEntryProcs=N limit number of entry processes
      --save-all-parameters save all parameters, even if they match default settings
      --json return results in json format [lve-utils 1.2-10+]

      Examples
      Reset all LVEs settings based on configuration in /etc/container/ve.cfg
      $ lvectl apply all

      Set new default CPU & Physical memory limit
      $ lvect set default --cpu=25 --pmem=256m

      Reset all LVE's killing processes inside them.
      $ lvectl destroy all

      Show list of LVEs and their limits:
      $ lvectl list
      Chấp Nhận Thua 1 Trận Chiến Nhưng Sẽ Thắng Cả Cuộc Chiến .

    3. #3
      Advisors
      Tham gia ngày
      Aug 2009
      Đến từ
      Nha Trang
      Bài gửi
      1.287

      Mặc định

      lveps
      lveps tool show information about running LVEs.

      Usage: lveps [-p] [-n] [-o <fmt1:width1,...>] [-d] [-c <time>] [-s <style>] [-t] [-h]
      Options
      -p to print per-process/per-thread statistics
      -n to print LVE ID istead of username
      -o to use formatted output (fmt=id,ep,pid,tid,cpu,mem,io)
      -d to show dynamic cpu usage instead of total cpu usage
      -c to calculate average cpu usage for <time> seconds (used with -d)
      -r to run under realtime priority for more accuracy (needs privileges)
      -s to sort LVEs in output (cpu, process, thread, mem, io)
      -t to run in the top-mode
      -h to print this brief help message

      Command like lveps -p will display processes running inside 'active' LVEs.
      Chấp Nhận Thua 1 Trận Chiến Nhưng Sẽ Thắng Cả Cuộc Chiến .

    4. #4
      Advisors
      Tham gia ngày
      Aug 2009
      Đến từ
      Nha Trang
      Bài gửi
      1.287

      Mặc định

      lvetop

      lvetop utility allows to monitor LVE usage

      $ lvetop

      ID EP PNO TNO CPU MEM I/O
      90 1 1 1 6% 13K 0
      user1 17 18 18 2% 56M 0
      user2 8 8 16 18% 72M 0

      lvetop fields
      ID user name if LVE id matches user id in /etc/passwd, or LVE id
      EP number of entry processes (concurrent scripts executed)
      PNO number of processes within LVE
      TNO number of threads within LVE
      CPU CPU usage by LVE, relative to total CPU resources of the server
      MEM Memory usage by LVE, in bytes
      I/O I/O usage (currently not implemented)
      Chấp Nhận Thua 1 Trận Chiến Nhưng Sẽ Thắng Cả Cuộc Chiến .

     

     
    + Trả lời bài viết

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

    Quyền viết bài

    • Bạn không thể gửi chủ đề mới
    • Bạn không thể gửi trả lời
    • Bạn không thể gửi file đính kèm
    • Bạn không thể sửa bài viết của mình