[Resolved] LiteSpeed + Cloudlinux : DNS resolution failed

Status
Not open for further replies.

mistwang

LiteSpeed Staff
#21
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.
 
#22
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
 

mistwang

LiteSpeed Staff
#23
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.
 
#24
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.
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
 

Attachments

#26
Not the CGI memory limit, the memory limit for the PHP external app.
http://www.litespeedtech.com/docs/webserver/config/extapps#memSoftLimit

Also take opcode cache memory into consideration against the memory limit.
You can let PHP execute "ulimit -a" to find out the current limit applied to PHP processes.
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 !
 
#27
What do you recommend for the memory Soft value ? In a general usage.
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!
 
#28
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
 
#29
http://piwik.domain.net/resolv.php
Code:
Resolution pour www.google.com: 173.194.40.148
Resolution pour mysql1.web4all.fr: 10.101.100.241
of course, we'd like to know the reason, to help you, other customers and us :)

the question is to how we can diagnose it. it'll be ideal if we can reproduce the issue in our lab. can you give us some hints most likely we can reproduce it by mimic your environment ?

are these domains fixed number or too many or just random ?
if only a few fixed number of these domains need to be resolved, can put domain-name IP
in /etc/hosts (not /etc/resolv.conf)
as a simple workaround until root cause discovered.

when it always working under apache, it's also under cloudlinux ?
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:
#30
change to "domain" per your example. :)

It should use the default 2047M no?
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.
 
#31
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 :)
 
#32
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)
 
#33
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)
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
 
Status
Not open for further replies.
Top