Results 1 to 6 of 6
  1. #1

    httpd.conf and my.cnf

    Can you help me set my httpd.conf and my.cnf files correctly or just tell me if am good or what would you change in them?

    Am attaching output of command ps -A and Top as a text file

    My hardware is dual amd opteron 256 w/ 2 gigs of ram

    thanks.

    file httpd.conf
    #-
    #Rlimit added by apachelimits.pl
    #-
    RLimitMEM 236849493
    RLimitCPU 240
    ##
    Alias /bandwidth/ /usr/local/bandmin/htdocs/

    Timeout 90
    KeepAlive On
    MaxKeepAliveRequests 300
    KeepAliveTimeout 5
    MinSpareServers 5
    MaxSpareServers 20
    StartServers 8
    MaxClients 500
    MaxRequestsPerChild 1000

    file my.cnf
    [mysqld]
    #datadir=/var/lib/mysql
    #socket=/var/lib/mysql/mysql.sock
    skip-locking
    skip-innodb
    query_cache_limit=1M
    query_cache_size=32M
    query_cache_type=1
    max_connections=500
    max_user_connections=500
    interactive_timeout=100
    wait_timeout=30
    connect_timeout=10
    thread_cache_size=128
    key_buffer=16M
    join_buffer=1M
    max_allowed_packet=16M
    table_cache=1024
    record_buffer=1M
    sort_buffer_size=2M
    read_buffer_size=2M
    max_connect_errors=10
    # Try number of CPU's*2 for thread_concurrency
    thread_concurrency=8
    myisam_sort_buffer_size=64M
    log-bin
    server-id=1

    [mysql.server]
    user=mysql
    basedir=/var/lib

    [safe_mysqld]
    err-log=/var/log/mysqld.log
    #pid-file=/var/lib/mysql/mysql.pid
    open_files_limit=8192

    [mysqldump]
    quick
    max_allowed_packet=16M

    [mysql]
    no-auto-rehash
    #safe-updates

    [isamchk]
    key_buffer=64M
    sort_buffer=64M
    read_buffer=16M
    write_buffer=16M

    [myisamchk]
    key_buffer=64M
    sort_buffer=64M
    read_buffer=16M
    write_buffer=16M

    [mysqlhotcopy]
    interactive-timeout
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    452
    There is no right or wrong answer here. You need to configure these two servers depending on the application load.

    Just few tips for httpd.conf:

    reduce the Timeout to 30 or 50 secs

    Either disable Keep Alive or lower Keep Alive Timeout to 2 seconds

    Increase MaxSpareServers to about 50

    Increase StartupServers to equal MaxSpareServers

    MaxRequestedPerChild reduce to around 500

    Good luck!
    Reliability Performance Integrity

  3. #3
    Join Date
    Jun 2003
    Location
    Janesville, Wi
    Posts
    1,516
    As for your my.cnf file, try changing the following:

    key_buffer = 256M
    thread_concurrency = 4
    query_cache_limit = 500K

    When making connections to MySQL, use persistant connections. This will generally result in less load on the server.

    Be aware that MySQL and Apache don't like each other. They fight for RAM almost constantly. MySQL runs better with a larger key_buffer. For example: I once worked on a box with a load of 15.00 and a key_buffer of 16M. When I changed the key_buffer to 256M, the load dropped to 1.

    If you see swapping, you need more RAM. MySQL uses more RAM than it lets on to. This is because the creation of temporary tables last, usually, for less than a fraction of a second. Swapping is a good indication of this.
    Last edited by Jakiao; 10-14-2006 at 08:11 PM.
    Jakiao

  4. #4
    Join Date
    Jan 2003
    Location
    U.S.A.
    Posts
    3,911
    It all depends on your servers performance with what you would need to change. How is your server loads?

  5. #5
    Quote Originally Posted by Matt.G
    It all depends on your servers performance with what you would need to change. How is your server loads?
    Load is about 5 to 7 so it's high, am gonna try the suggestions for 24 hours and get back to you

    thanks

  6. #6
    Join Date
    Jul 2003
    Location
    Goleta, CA
    Posts
    5,550
    Use an application like mysqlreport to tune your mysql configuration for your needs.
    Patron: I'd like my free lunch please.
    Cafe Manager: Free lunch? Did you read the fine print stating it was an April Fool's joke.
    Patron: I read the same way I listen, I ignore the parts I don't agree with. I'm suing you for false advertising.
    Cafe Owner: Is our lawyer still working pro bono?

Posting Permissions

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