[solved] LiteSpeed + Cloudlinux : DNS resolution failed

Discussion in 'Install/Configuration' started by benoit.georgelin, Jan 24, 2014.

  1. mistwang

    mistwang LiteSpeed Staff

    Can you capture one strace with success DNS lookup, one strace with failed DNS lookup.
    Do a comparison see when they start to show the difference.
  2. It's not easy to trace exactly the full process as the first lsphp fork another one directly.

    Here is something that can help maybe ?

    Code:
    open("/lib64/libnss_dns.so.2", O_RDONLY) = 4
    read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\20\0\0\0\0\0\0"..., 832) = 832
    fstat(4, {st_mode=S_IFREG|0755, st_size=27424, ...}) = 0
    mmap(NULL, 2117880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = -1 ENOMEM (Cannot allocate memory)
    close(4)                                = 0
    munmap(0x7f0f5f00b000, 42509)           = 0
    
  3. mistwang

    mistwang LiteSpeed Staff

    OK, looks like we got it. It failed to mmap() 2MB for the DNS lib.
    Maybe the memory limit for lsphp external app was set too low, or the LVE memory limit was too low. raise the memory limit should fix it.
  4. I have big memory limit on se server configuration side and LVE is very high.
    Can you tell me if the memory limit is correct on the attached file ?

    Merci

    Attached Files:

  5. mistwang

    mistwang LiteSpeed Staff

  6. It looks that it's working :):)

    What do you recommend for the memory Soft value ? In a general usage.
    Is there a specific way to have a global value or should I set it for each external application ?

    Here are default values (unlimit -a)

    Code:
    core file size (blocks, -c) 0
    data seg size (kbytes, -d) unlimited
    scheduling priority (-e) 0
    file size (blocks, -f) unlimited
    pending signals (-i) 94922
    max locked memory (kbytes, -l) 64
    max memory size (kbytes, -m) unlimited
    open files (-n) 6000
    pipe size (512 bytes, -p) 8
    POSIX message queues (bytes, -q) 819200
    real-time priority (-r) 0
    stack size (kbytes, -s) 10240
    cpu time (seconds, -t) unlimited
    max user processes (-u) 400
    virtual memory (kbytes, -v) 460800
    file locks (-x) unlimited
    Thanks !
  7. NiteWave

    NiteWave Administrator

    for a default installation, lsws now set lsphp5 external app->memory soft/hard limit to 2047M. i.e., almost no limit, to better match apache's setting.

    glad to figure out the difficult issue. Thanks!
  8. Ok !

    Thanks you very much fort you help on this case !

    I don't really understand why it's not working well if there is no value used on the external apps configuration . It should use the default 2047 no?

    For now it's working :)
    Happy to see that.

    Cheers
  9. Is it possible to remove the link reference from your post please ? :)
    Just ovoid domain reference about some domain that was not for proposal testing.
    Thanks you
    Last edited by a moderator: Jan 29, 2014
  10. NiteWave

    NiteWave Administrator

    change to "domain" per your example. :)

    the default value is set in configuration file. i.e., lsws/conf/httpd_config.xml, when install new lsws.
    in the past, memory soft/hard limit os 250M/300M
    recently I noticed being 2047M/2047M for a new lsws installation.

    this setting is lsws specific, apache don't have it.
    it's used to prevent a lsphp process consume too many memory unexpectedly.
  11. Thanks for changing the domain name ;)

    I don't use Apache2 configuration files.
    Only LiteSpeed.

    The default configuration in Litespeed in Server => Security is about CGI-Script

    Code:
          <memSoftLimit>450M</memSoftLimit>
          <memHardLimit>500M</memHardLimit>
          <procSoftLimit>400</procSoftLimit>
          <procHardLimit>450</procHardLimit>
    
    The help bubble say :

    Code:
    Specifies the memory consumption limit in bytes for an external application process or an external application started by the server.
    
    So I'm surprised to have to set MemoryLimit on the Vhost Configuration in the external app

    Calling piwk index file is not consuming 500M of memory for sure :)
  12. NiteWave

    NiteWave Administrator

    yes, maybe the document can be further improved ... may confuse people like your case.

    to my understanding, those settings is for CGI, but not include fast-cgi, while lsphp belong to fast-cgi. but for people who is new to lsws, very likely not aware of the difference -- isn't fast-cgi a sort of cgi ?
    it may waste a lot of time if there is a misunderstanding from the beginning

    the setting(server wide) for lsphp is at
    Server -> External App -> lsphp5 ->
    Memory Soft Limit (bytes)
    Memory Hard Limit (bytes)
  13. Thanks, I understand better !

    As I'm not using Server -> External App -> lsphp5 but
    VirtualHost -> $DOMAIN -> External App -> lsphp5-$DOMAIN
    I have to configure ervery specific external App !

    No more question over here :)
    Merci

Share This Page