Solaris 11 - opened files limit ?

Hey all,

I'm running apache (cswapache2) on a Solaris 11.3 server.

Recently, if I create a new vhost, the service fails to restart, and enters in maintenance mode.
If I comment lines with log files, the service starts again.

I guess I've reached the limit.

I checked the current values with ulimit -a and get :

core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 10
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 29995
virtual memory          (kbytes, -v) unlimited

I can increase the limit, but would like to be sure that it's the issue.
Did anyone experienced it too ?

It rings alarm bells with me if commenting out log directives makes it work.

Where are the logs specified to go????

They should be like:

logs/website1

and NOT

logs/website1/logfile

As far as I remember, and I might be wrong, Apache cannot access a subdirectory of the logs directory and will crash on startup.

@hicksd8 :

For each vhost, a specific log file is specified such as :

<VirtualHost *:443>
        ServerName blablabla . com
        SSLEngine On
                SSLProtocol ALL -SSLv2 -SSLv3
                SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:!RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM;
                SSLHonorCipherOrder on
        <Proxy *>
                AddDefaultCharset Off
                Order deny,allow
                Allow from all
        </Proxy>
        Redirect permanent /]h t t p://bliblibli.com
        ErrorLog "/opt/csw/apache2/var/log/error_default.blablabla.lu_443.log"
        TransferLog "/opt/csw/apache2/var/log/access_default.blablabla.lu_443.log"
</VirtualHost>

Referring back to your post#1, if you were hitting a system wide files open limit or something like that, you should be able to test for that easily by running another application or script which opens, say, 20 files. If you were against a files open limit that app/script would fall over. I am inclined to believe that this is an Apache configuration error. Being able to comment out logfile directives and it then works tells me this is the case.

Referring to your post#3 it immediately strikes me that you are specifying a TransferLog directive without a prior LogFormat directive (so how does it know what it has to log???). I think your need to check out the configuration via the Apache bible:
mod_log_config - Apache HTTP Server Version 2.4

Perhaps someone on this forum with more Apache experience than I will help you more.

I'm running apache 2.2, and the syntax looks to match with apache wiki's examples
wiki.apache.org / httpd/ExampleVhosts

<VirtualHost *:80>
ServerName w w w . foo . com

# if you want this vhost to listen to extra names, uncomment the next line
# ServerAlias foo . com w w w . bar . com bar . com

DocumentRoot /var/www/www . foo . com/htdocs

CustomLog /var/log/apache/www . foo . com-access . log combined
ErrorLog /var/log/apache/www . foo . com-error . log
</VirtualHost>

Yes, but your post#5 shows an illustration of the use of 'CustomLog' directive BUT in your post#3 you are using the 'TransferLog' directive. They are different.

Look again at the link that I provided in my post#4 and read what is says about 'TransferLog'. It's format cannot be specified explicitly but is taken from a prior 'LogFormat' directive.

1 Like

Peek the running process for their files:

pfiles <pid>

Examine all the httpd processes in one go:

pfiles `pgrep httpd`

Are they close to 256?

@MadeInGermany,

pgrep logger | wc -l returned 64
pgrep httpd| wc -l returned 52

°

That's something else: the number of processes.
The "pgrep httpd" in backticks gives the pids, and the "pfiles" gives the "file descriptors".

pfiles `pgrep httpd`
pfiles `pgrep httpd` | grep 'file descriptors'