1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

new server, need optimization, high swap usage

Discussion in 'Server Configuration and Hosting' started by dotpro, Jan 20, 2015.

  1. dotpro

    dotpro Active Member


    I recently moved my websites to new dedicated server and need help optimizing it.

    Dedicated server: Yes
    SSD or SATA: 4x SSD in RAID10
    RAID or non-RAID (and hardware or software) and if RAID what level: HW/RAID10
    Memory: 64GB
    CPU: Dual CPU HEX Core E5-2620 0 @ 2.00GHz
    HTTP server used: Litespeed entperprise
    PHP processor used: fcgi
    version of PHP: 5.4
    OpCode caching enabled: no
    Memcached being used? no, i have xcache installed

    I am noticing high swap usage and only 6% of the RAM being used.
  2. Slavik

    Slavik XenForo Moderator Staff Member

    What does

    cat /proc/swaps

  3. dotpro

    dotpro Active Member

    thanks, it returns:

    Filename Type Size Used Priority
    /dev/sdb7 partition 4300796 445748 -1
  4. Slavik

    Slavik XenForo Moderator Staff Member

    Whats your /proc/sys/vm/swappiness set to?
  5. dotpro

    dotpro Active Member

  6. dotpro

    dotpro Active Member

    I managed to set the value to 0 and swap is still at about 7% usage.

    I restarted mysql and got these errors:
    150113 1:14:45 [ERROR] /usr/sbin/mysqld: Sort aborted: Error writing file '/tmp/MYVMHTKN' (Errcode: 28)
    150113 1:14:45 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_7d50_22.MYI'; try to repair it

    /tmp dir is about 10% full.
  7. Sheratan

    Sheratan Well-Known Member

    I think swap usage 7% is quite normal with that much RAM, with 10% /tmp too

    If you want to swap usage 0% you can try to disable swap :D *not reccomended*

    How much your RAM usage right now?
  8. dotpro

    dotpro Active Member

    Right now 6% RAM usage. My previous server lingered around 30% with occasional spikes and never used swap (it was not disabled).

  9. Jim Boy

    Jim Boy Well-Known Member

    SWAP can be used by the server when idling. What happens is that it puts some of the Memory into SWAP, 'just in case', but it doesn't remove the data from regular memory. The level to which it does that is determined by swappiness. If you want to stop it, set swappiness to zero. But as it only writes during idle and doesn't remove anything from RAM, it should not be impacting on your system at all.
    Xon likes this.
  10. dotpro

    dotpro Active Member

    Thanks everyone.

    Is there anything else I can do to optimize the server for best performance?
  11. RoldanLT

    RoldanLT Well-Known Member

    Install the LiteSpeed Cache XenForo addon :).
    maszd likes this.
  12. dotpro

    dotpro Active Member

    :) Thanks, that was on my list but it would be for xf forums only... I was asking in optimization in general for mysql/litespeed, etc.
  13. RoldanLT

    RoldanLT Well-Known Member

    Replace Oracle Mysql with Percona or MariaDB 10.
  14. dotpro

    dotpro Active Member

  15. RoldanLT

    RoldanLT Well-Known Member

  16. dotpro

    dotpro Active Member

    1 ad, 8 avatars load on homepage
    is that different add-on?
    i thought that is what the LiteSpeed Cache XenForo addon was for above?

    XF needs its own EVA2000 :D
    I feel like I am not going anywhere even with SSDs and litespeed...
  17. RoldanLT

    RoldanLT Well-Known Member

    I'm not expert in litespeed, but all I know is this: https://xenforo.com/community/resources/xenforo-litespeed-cache.2704/
    But I think it doesn't cache all pages for the guest.

    He is already here helping a lot :)
    tagging :D @eva2000
  18. eva2000

    eva2000 Well-Known Member

    RoldanLT likes this.
  19. Walter

    Walter Well-Known Member

    How much RAM have you dedicated to Mysql?
  20. dotpro

    dotpro Active Member

    Oh, good to know. Should I post on vb or your forum?

    This is what my.cnf looks like:

    # safe-show-database
    key_buffer_size = 12G
    query-cache-type = 1
    query-cache-size = 128M


Share This Page