Connection Speed. anyway to get a faster connection ?

Get help with using the PHP Secure Communications Library.

Moderator: Nuxius

Forum rules
The purpose of this forum is to provide support for phpseclib, a pure PHP SSH / SFTP / RSA library.

Posts by new users are held in a moderation queue and are not publicly visible until the post is approved.

Re: Connection Speed. anyway to get a faster connection ?

Postby ramon » Sun Jul 15, 2012 9:48 am

doing

Code: Select all
<?php
echo 'hello world!';
?>


is instant..

I have some advanced scripts that interact with MySQL etc they all run virtually instantly.
If I try using a telnet class, that seems to be fast 1-2 seconds to complete, but I need to use SSH so I can use this on multiple devices !!

Thanks :)
ramon
Traveler
 
Posts: 13
Joined: Tue Jul 03, 2012 3:13 pm

Re: Connection Speed. anyway to get a faster connection ?

Postby TerraFrost » Sun Jul 15, 2012 3:00 pm

Is the script saying "took 0.25 seconds" or whatever?
TerraFrost
Legendary Guard
 
Posts: 12217
Joined: Wed Dec 04, 2002 6:37 am

Re: Connection Speed. anyway to get a faster connection ?

Postby ramon » Tue Jul 17, 2012 8:04 pm

This script took about 5 seconds to complete :

Code: Select all
<?php
include('Net/SSH2.php');

define('NET_SSH2_LOGGING', NET_SSH2_LOG_COMPLEX);

$start = microtime(true);
$ssh = new Net_SSH2('127.0.0.1');
if (!$ssh->login('root', 'password')) {
    exit('Login Failed');
    }

//    echo $ssh->exec('pwd');
//    echo $ssh->exec('ls -la');

    //echo $ssh->getLog();
    $elapsed = microtime(true) - $start;
    echo "<hr>took $elapsed seconds<br>";
    ?>


But shows on screen as : took 0.527486 seconds
ramon
Traveler
 
Posts: 13
Joined: Tue Jul 03, 2012 3:13 pm

Re: Connection Speed. anyway to get a faster connection ?

Postby TerraFrost » Tue Jul 17, 2012 8:36 pm

What if you move the "$start = microtime(true);" line to above the include('Net/SSH2.php') line?
TerraFrost
Legendary Guard
 
Posts: 12217
Joined: Wed Dec 04, 2002 6:37 am

Re: Connection Speed. anyway to get a faster connection ?

Postby ramon » Thu Jul 19, 2012 6:20 pm

That returns :
took 0.177876 seconds

Timing it took about 5 seconds.
ramon
Traveler
 
Posts: 13
Joined: Tue Jul 03, 2012 3:13 pm

Re: Connection Speed. anyway to get a faster connection ?

Postby TerraFrost » Fri Jul 20, 2012 12:50 pm

Well I don't know what you expect me to do.

If all the lines, together, take 0.17 seconds to execute, then clearly the problem isn't with any particular line of code. There are 4.83 other seconds that are still unaccounted for. And if it's not any of the individual lines of code...

I have a few other ideas of things you could reproduce this slowdown with non-phpseclib code (which would presumably prove that it's a problem with your PHP setup) but I'd have to walk you through them and you might not do what I had had in mind and I might have to clarify and.... what would it get me? This isn't a general purpose support forum - this is a phpseclib support forum.

Good luck!
TerraFrost
Legendary Guard
 
Posts: 12217
Joined: Wed Dec 04, 2002 6:37 am

Re: Connection Speed. anyway to get a faster connection ?

Postby ramon » Sat Jul 28, 2012 12:24 pm

Thanks for taking the time to look at this.

The code I have posts is exactly what is being used.. nothing more.
So it can't be 'my' code as there is no my code.. just the example script.

if I do a similar test using a php telnet class it works fine, only a .5 - 1 second delay while that class logs in.
No idea why this isn't working.

Thanks anyway :(
ramon
Traveler
 
Posts: 13
Joined: Tue Jul 03, 2012 3:13 pm

Previous

Return to phpseclib support

Who is online

Users browsing this forum: No registered users and 1 guest