Litespeed and bytes log ( directadmin)

#1
Hello
as i see Litespeed generates Cpanel log bytes format output
I use litespeed with directadmin integration and this output shows me gigabates instead of kilobytes..

-Request in Apache to a site with some text and 28kb image shows output

1110 331
29166 338

29166 /1024 =~ 28,2 KB ,its ok

-Request in Litespeed to a site with some text and 128kb image shows output

1346233969 1373 .
1346233969 131075 .

1346233969/1024 /1024 .... =~ 1,25 Gb (!)

So directadmin shows a strange transfer usage...


how to change it to apache log format, thanks
 

NiteWave

Administrator
#2
what's your current bytes log format setting? search "CustomLog" in apache's httpd.conf

1346233969 1373
1346233969 131075
maybe 2nd field "131075" is the image size(128k).
and the first field is the time stamp.
 
#3
my integration with directadmin is not based on apache.conf , i am doing it manually, like adding xml vhost to httpd_config.xml , deleting etc..

So, i create vhost in litespeed manually
As you can see i can only set "Log Format" for access log, can not make any modyfication for bytes log format.
And yes, you are right, the first column is a timestamp , second is a bandwidth log
how can i delete that timestamp from log or modyfy that log

Directadmin reads that timestamp as it is a output log
 
Last edited:

NiteWave

Administrator
#4
CPanel compatible bandwidth log format looks to be "%{%s}t %I .\n%{%s}t %O ."

As you can see i can only set "Log Format" for access log, can not make any modyfication for bytes log format.
you are right, for native vhost, the bytes log format is fixed and not customizable.

can you share what's directadmin's bytes log format?
 

NiteWave

Administrator
#6
apparently it's hardcoded at present.
maybe can add this feature -- will report the request.

any other issue when you convert directadmin vhost to lsws native vhost?
 
#7
for now i found only this one issue
i have a enterprise 2 cpu license 64bit, it is possible to rebuild a binary for me?

by the way i would ask about CPU license. I have bought 2 CPU license , but in my opinion it is not a 2 CPU license , it is 2 "worker license", each "worker" is handling static or php request. So logically in huge server load it will be working much better than 1 CPU license.
I see in system ( mpstat -P ALL) that all my 8 cores are working when handling requsts. :)
 
Last edited:

NiteWave

Administrator
#9
I think you can work a quick solution to work around it.

for example, create a cron job to run every minute, to process the bytes log file created by lsws. here's an example:

#mv lsws_bytes.log tmp.log
#your_translate.sh tmp.log > tmp2.log
#cat tmp2.log >> da_bytes.log
#rm -f tmp.log
#rm -f tmp2.log

da_bytes.log is bytes log format recognized by directadmin

please first command:
#mv lsws_bytes.log tmp.log

this is enough -- in apache, you have to send a signal to apache process, so apache will create new lsws_bytes.log.
in lsws, just mv it, lsws will create new lsws_bytes.log automatically.

your understanding regarding license is correct
 
#10
hello
that is an idea. By hosting 1000 domain could be a little problem , but a proper bash script should handle with this.

Could you add that feature in the next release to choose what bytes log format will be generated in LSWS ?
 

NiteWave

Administrator
#11
there is another general way to do it:

lsws admin console->Configuration->Virtual Hosts: select a vhost

->General->Apache Style configurations
enter
LogFormat "%O %I" bytes_log_format
CustomLog /usr/local/lsws/DEFAULT/logs/bytes.log bytes_log_format

will generate the bytes log file /usr/local/lsws/DEFAULT/logs/bytes.log

-- tested in my local lsws.
 
Top