Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2009
    Posts
    40

    Config my new VPS correctly.

    Hey Everybody

    Finally i got around to buying a vps. Not having used linux before yesterday many of these values are new to me and they may need tweaking compared to the guides i found on the net and on this site. I hope you more experienced users.

    Vps info
    1.5gb ram
    4gb burst
    100gb space
    No swap
    CPU speed is good, its a new server and there are only 2 vps accounts on the server. So far.


    Not sure what tweaks are a must, but i read somewhere that unused ram are wasted ram. Dont want that. But im not sure my current needs can use all the ram.

    httpd.conf as i is now
    PHP Code:
       1. KeepAlive On
       2. MaxKeepAliveRequests 100
       3. KeepAliveTimeout 1
       4. MinSpareServers 5
       5. MaxSpareServers 10
       6. StartServers 5
       7. MaxClients 150
       8. MaxRequestsPerChild 1000 
    my.conf
    PHP Code:
    [mysqld]
    max_connections 400
    key_buffer 
    16M
    myisam_sort_buffer_size 
    32M
    join_buffer_size 
    1M
    read_buffer_size 
    1M
    sort_buffer_size 
    2M
    table_cache 
    1024
    thread_cache_size 
    286
    interactive_timeout 
    25
    wait_timeout 
    1000
    connect_timeout 
    10
    max_allowed_packet 
    16M
    max_connect_errors 
    10
    query_cache_limit 
    1M
    query_cache_size 
    16M
    query_cache_type 
    1
    tmp_table_size 
    16M
    skip
    -innodb
     
    [mysqld_safe]
    open_files_limit 8192
     
    [mysqldump]
    quick
    max_allowed_packet 
    16M
     
    [myisamchk]
    key_buffer 32M
    sort_buffer 
    32M 
    php.ini
    PHP Code:
    Standard php.ini load settings

    max_execution_time 
    30     Maximum execution time of each scriptin seconds
    max_input_time 
    60    Maximum amount of time each script may spend parsing request data
    ;max_input_nesting_level 64 Maximum input variable nesting level
    memory_limit 
    128M      Maximum amount of memory a script may consume (128MB)
    session.gc_maxlifetime 1440
    post_max_size 
    8M

    Xcache setup
    [xcache]
    xcache.shm_scheme =        "mmap"
    xcache.size  =              256M
    xcache
    .count =                 4
    xcache
    .slots =                8K
    xcache
    .ttl   =              3600
    xcache
    .gc_interval =         300

    Same as aboves but for variable cache
    ; If you don't know for sure that you need this, you probably don't
    xcache
    .var_size  =           256M
    xcache
    .var_count =             1
    xcache
    .var_slots =            8K
    xcache
    .var_ttl   =             0
    xcache
    .var_maxttl   =          0
    xcache
    .var_gc_interval =     300

    N/for /dev/zero
    xcache
    .readonly_protection Off

    xcache
    .mmap_path =    "/dev/zero"

    xcache.cacher =               On
    xcache
    .stat   =               On

    read_buffer 
    16M
    write_buffer 
    16M 
    I would love your expert opinion on how to optimize these settings according to the vps limits.

    DYSW
    Last edited by DYSW; 11-06-2009 at 09:13 AM.

  2. #2
    Join Date
    Oct 2009
    Location
    Ha Noi
    Posts
    21
    xcache.var_size: You set from 32 to 64M or 0.

  3. #3
    Join Date
    Nov 2009
    Posts
    40
    Its set at 256m. 0 if it means unlmited, isnt that a bit irresponsible ?

  4. #4
    Join Date
    Oct 2009
    Location
    Ha Noi
    Posts
    21
    Quote Originally Posted by DYSW View Post
    Its set at 256m. 0 if it means unlmited, isnt that a bit irresponsible ?
    No, 0 is "none". Don't unlimited.

  5. #5
    Join Date
    Mar 2005
    Location
    Labrador, Canada
    Posts
    951
    Your httpd.conf:

    MaxClients 150

    That's 150 simultaneous connections to Apache. You want to be careful as that will use a lot of memory. Consider bringing it down -- maybe to 50.

    Your my.cnf:

    max_connections = 400
    key_buffer = 16M
    ...
    join_buffer_size = 1M
    read_buffer_size = 1M
    sort_buffer_size = 2M

    max_connections is (again) simultaneous connections.

    Every client that connects will use those *_buffer_sizes. They total 4M. So you're saying it's OK to use up to 400 * 4M = 1600M of memory for clients. Are you sure you want that?

    Consider bringing max_connections down -- to maybe 50-100.

    ---

    By setting this limits to realistic values you help ensure that your VPS won't crash for lack of memory. Always calculate based on your guaranteed memory. Ignore 'burst memory' as it simply may not be available for you to use.

Similar Threads

  1. How to set the SPF correctly settings for my VPS?
    By cyberderf in forum Hosting Security and Technology
    Replies: 1
    Last Post: 01-29-2008, 07:38 AM
  2. ntop - how to run correctly?
    By andren in forum Web Hosting
    Replies: 0
    Last Post: 10-05-2005, 09:42 AM
  3. libtool problem with config.lo while apache config/make
    By one1coolone1 in forum Dedicated Server
    Replies: 3
    Last Post: 04-20-2005, 11:15 PM
  4. Where is config.xml - Trying to config Cerberus
    By sabotage79 in forum Hosting Security and Technology
    Replies: 2
    Last Post: 02-13-2003, 07:36 PM
  5. PHP not working correctly
    By The Laughing Cow in forum Hosting Security and Technology
    Replies: 6
    Last Post: 07-22-2002, 03:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •