~ is faster than

because it doesnt have to resolve your hostname? How do you know it is faster? Are you just guessing the loading time?
 
Well, it is server side and used a simple microtime to calculate the start and end time.

This is the code I am using, This is just something fast I made to find slow code parts and optimize it. It just peeked my interest because I noticed the execute time difference.

Code:
<?php

    if( ! defined('APPPATH') )  die('You are not allowed to be here!');
    
    // Simple Benchmarking
    class Bench
    {
        // times
        static $times = array();
        
        // debug
        static $debug = true;
        
        public static function start( $id )
        {
            if( ! self::$debug)
            {
                return;
            }
            
            self::$times[$id] = microtime();
        }
        
        public static function end( $id )
        {
            if( ! self::$debug )
            {
                return;
            }
            
            $elapsed = (microtime() - self::$times[$id]) * 1000;
            $elapsed = abs($elapsed); // positive
            $elapsed = round($elapsed, 4);
            
            echo "[$id]Loaded in " . $elapsed . " MS<br />";
        }
        
        
    }
    
    
?>
 
You might find a better response on a linux webforum or something like webhostingtalk.com. I doubt many people here would know the answer and I doubt it is directadmin related at all.
 
You might find a better response on a linux webforum or something like webhostingtalk.com. I doubt many people here would know the answer and I doubt it is directadmin related at all.

Thank you for the tip, might post this also later on webhostingtalk. But I do think it is DA related, because do set everything up, and basically manage it. To me it feels like somewhere it loses something, and DA could be faster because of that.
 
In what mode do you have php installed? cli/cgi/version?

In some php setups ~ isn't being executed as the user e.g. mod_ruid2, where this does happen when using a virtual host. I wouldn't think it's something in apache really (other than how php is configured) as it seems you're only testing it when php starts and ends, so it should be something on how php is executed and not when.
 
In what mode do you have php installed? cli/cgi/version?
In some php setups ~ isn't being executed as the user e.g. mod_ruid2, where this does happen when using a virtual host. I wouldn't think it's something in apache really (other than how php is configured) as it seems you're only testing it when php starts and ends, so it should be something on how php is executed and not when.

I'm using CLI, with MEMCACHE and APC enabled, php 5.3 CLI, apache 2.2, and ruid is probably not installed according to "grep 'mod_ruid2' /etc/httpd/conf/httpd.conf"
 
Just guessing here, maybe the apc is a factor? You could maybe try disable it and see if the difference is gone.
 
I do think it is DA related, because do set everything up, and basically manage it. To me it feels like somewhere it loses something, and DA could be faster because of that.
It's not DirectAdmin related in the sense that any of the steps your packets take on their roundtrip go through any DirectAdmin processes; they do not.

It may be DirectAdmin related in that DirectAdmin could set up Apache to manage those packets more quickly.

Of course there's something to be said about the time it takes to translate the URL address to an IP#; it's not much time after the original lookup, but it has to be done a lot.

Have you tested it on a hand-tuned apache server without DirectAdmin? What was the difference there?

And if you haven't, then it's quite a bit premature to blame it on DirectAdmin's default configuration.

Jeff
 
It is DA related, he is comparing the usage of ip/~user/ vs example.com/, both setup by DA. As it is a php script testing it, it can't be the client waiting on a resolve or something.

I wouldn't talk in terms of blaming; it may just be interesting to know if this is true for everyone and why, and if it can be fixed.

@TS maybe you could share a fully working php script, so I and perhaps others can test it as well.
 
Sorry to make you think like that jeff, indeed like Arieh said, I did not ment to blame anyone, also if it was something to blame for I would've chosen to use nginx as webserver. This is just for my personal website(and dev) so I do not mind 6 or even 12 ms, which is barely anything anyway. I incidently noticed that because I was benchmarking something I was making. So, I got a little interested in it.

Also, i'm fully aware what the tasks of DA are.

About the script, sorry, cannot give it since it is something I am creating myself. It's a whole framework. I can imagine that if you get another light weight application, You'll see the difference.

the subdomain has been changed in '/etc/hosts' to the server ip

Code:
[root@hosted-by admin]# ab -t 30 -c 10 http://******/~dev/mvc/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking (********) (be patient)
Finished 3890 requests


Server Software:        Apache/2
Server Hostname:        (********)
Server Port:            80

Document Path:          /~dev/mvc/
Document Length:        9850 bytes

Concurrency Level:      10
Time taken for tests:   30.003 seconds
Complete requests:      3890
Failed requests:        3209
   (Connect: 0, Receive: 0, Length: 3209, Exceptions: 0)
Write errors:           0
Total transferred:      39767421 bytes
HTML transferred:       38316451 bytes
Requests per second:    129.65 [#/sec] (mean)
Time per request:       77.128 [ms] (mean)
Time per request:       7.713 [ms] (mean, across all concurrent requests)
Transfer rate:          1294.40 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.8      0      29
Processing:    33   77  26.0     73     285
Waiting:       29   68  22.5     63     284
Total:         33   77  26.2     73     285

Percentage of the requests served within a certain time (ms)
  50%     73
  66%     82
  75%     87
  80%     91
  90%    104
  95%    123
  98%    150
  99%    169
 100%    285 (longest request)

Code:
[root@hosted-by admin]# ab -t 30 -c 10 http://dev.(********)/mvc/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking dev.(********) (be patient)
Finished 2263 requests


Server Software:        Apache/2
Server Hostname:        dev.(********)
Server Port:            80

Document Path:          /mvc/
Document Length:        9778 bytes

Concurrency Level:      10
Time taken for tests:   30.007 seconds
Complete requests:      2263
Failed requests:        2192
   (Connect: 0, Receive: 0, Length: 2192, Exceptions: 0)
Write errors:           0
Total transferred:      22970511 bytes
HTML transferred:       22126039 bytes
Requests per second:    75.42 [#/sec] (mean)
Time per request:       132.597 [ms] (mean)
Time per request:       13.260 [ms] (mean, across all concurrent requests)
Transfer rate:          747.57 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   1.4      0      36
Processing:    39  132  53.1    122     465
Waiting:       38  119  50.4    109     431
Total:         39  132  53.4    122     466

Percentage of the requests served within a certain time (ms)
  50%    122
  66%    136
  75%    145
  80%    153
  90%    186
  95%    243
  98%    321
  99%    351
 100%    466 (longest request)
 
Sorry to make you think like that jeff
There's nothing to apologize to me for; I'm simply pointing out that the real issue is in the Apache configuration, and that the place to start testing is with various Apache configurations. Then when anyone comes up with one which is faster, we can hopefully get it implemented in DirectAdmin.

Jeff
 
Back
Top