Estoy utilizando el modulo "Net::SSH::Perl" y aleatoriamente las conexiones son muy lentas, del orden de 15-20 segundos, incluso más... Descartado por completo que pueda tener relación con cualquier componente de red, buscando he encontrado que a prácticamente todo el mundo lo ocurre lo mismo
http://www.google.es/search?q=Net::SSH::Perl+slow
El problema parece estar relacionado con el modulo "Math::BigInt".. tras darle muchas vueltas y probar con diferentes soluciones el problema persiste..
http://www.senin.org/weblog/2007/01/30/ ... etsshperl/
La salida de dprofpp para una ejecución normal es:
# dprofpp
Total Elapsed Time = 2.260640 Seconds
User+System Time = 1.730640 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
6.76 0.117 0.330 16 0.0073 0.0206 Net::SSH::Perl::Util::SSH2MP::mp2b
in
5.03 0.087 0.218 445 0.0002 0.0005 Math::BigInt::badd
4.28 0.074 0.095 912 0.0001 0.0001 Math::BigInt::copy
4.04 0.070 0.075 1 0.0695 0.0750 <anon>:/usr/local/share/perl/5.8.8
/Crypt/DH.pm:6
3.47 0.060 0.081 11 0.0055 0.0074 Net::SSH::Perl::Util::SSH2MP::bin2
mp
3.47 0.060 0.060 5 0.0120 0.0120 Math::BigInt::GMP::_modpow
3.41 0.059 0.058 1 0.0592 0.0579 <anon>:/usr/local/share/perl/5.8.8
/Convert/ASN1.pm:425
3.18 0.055 0.098 532 0.0001 0.0002 Math::BigInt::new
2.66 0.046 0.046 1709 0.0000 0.0000 Math::Pari::pari2num_
2.37 0.041 0.104 458 0.0001 0.0002 Math::BigInt::objectify
2.37 0.041 0.041 939 0.0000 0.0000 Math::BigInt::round
2.31 0.040 0.040 1001 0.0000 0.0000 Math::Pari::_gadd
2.02 0.035 0.379 5 0.0071 0.0758 Convert::ASN1::os2ip
1.50 0.026 0.206 79 0.0003 0.0026 <anon>:(eval
1.50 0.026 0.026 1693 0.0000 0.0000 Math::Pari::_gsub
Cuando tarda en conectar los motivos parecen ser dos, uno de los casos:
# dprofpp
Total Elapsed Time = 21.01968 Seconds
User+System Time = 0.979680 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
15.1 0.148 0.245 16 0.0093 0.0153 Net::SSH::Perl::Util::SSH2MP::mp2b
in
7.25 0.071 0.071 8906 0.0000 0.0000 Math::Pari::DESTROY
5.61 0.055 0.055 1473 0.0000 0.0000 Math::BigInt::GMP::DESTROY
5.10 0.050 0.050 5 0.0100 0.0100 Math::BigInt::GMP::_modpow
4.08 0.040 0.037 1 0.0398 0.0375 <anon>:/usr/local/share/perl/5.8.8
/Crypt/DH.pm:6
3.16 0.031 0.031 932 0.0000 0.0000 Math::BigInt::modify
3.06 0.030 0.030 8 0.0037 0.0037 Exporter::export
2.65 0.026 0.026 428 0.0001 0.0001 Math::BigInt::GMP::_add
2.25 0.022 0.023 907 0.0000 0.0000 Math::BigInt::copy
2.04 0.020 0.020 988 0.0000 0.0000 Math::Pari::_gmul
2.04 0.020 0.029 1 0.0196 0.0290 <anon>:/usr/local/share/perl/5.8.8
/Convert/ASN1.pm:425
1.84 0.018 0.030 528 0.0000 0.0001 Math::BigInt::new
1.63 0.016 0.015 177 0.0001 0.0001 Crypt::DES::decrypt
1.33 0.013 0.104 446 0.0000 0.0002 Math::BigInt::badd
1.33 0.013 0.013 1693 0.0000 0.0000 Math::Pari::_gsub
Otro caso en donde el culpable parece ser Crypt:: DH:
# dprofpp
Total Elapsed Time = 21.49335 Seconds
User+System Time = 0.853350 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
8.09 0.069 0.074 1 0.0694 0.0737 <anon>:/usr/local/share/perl/5.8.8
/Crypt/DH.pm:6
7.15 0.061 0.022 16 0.0038 0.0014 Net::SSH::Perl::Util::SSH2MP::mp2b
in
7.03 0.060 0.060 5 0.0120 0.0120 Math::BigInt::GMP::_modpow
5.62 0.048 0.048 1693 0.0000 0.0000 Math::Pari::_gmod
4.69 0.040 0.031 11 0.0037 0.0028 Net::SSH::Perl::Util::SSH2MP::bin2
mp
4.57 0.039 0.055 1 0.0394 0.0548 <anon>:/usr/local/share/perl/5.8.8
/Net/SSH/Perl.pm:16
4.57 0.039 0.057 1 0.0390 0.0574 <anon>:/usr/local/share/perl/5.8.8
/Convert/ASN1.pm:425
3.28 0.028 0.037 95 0.0003 0.0004 Exporter::import
3.16 0.027 -0.032 5 0.0054 - Convert::ASN1::os2ip
3.16 0.027 0.031 70 0.0004 0.0004 Net::SSH::Perl::Buffer::new
2.34 0.020 0.020 1 0.0199 0.0198 <anon>:/usr/lib/perl/5.8/IO/Select
.pm:10
2.34 0.020 0.019 1 0.0199 0.0195 <anon>:/usr/local/share/perl/5.8.8
/Net/SSH/Perl/Kex/DH1.pm:19
2.34 0.020 0.036 1 0.0197 0.0356 <anon>:/usr/local/share/perl/5.8.8
/Convert/ASN1.pm:63
2.34 0.020 0.020 14 0.0014 0.0014 DynaLoader::dl_load_file
2.34 0.020 0.028 1 0.0195 0.0278 <anon>:/usr/local/share/perl/5.8.8
/Net/SSH/Perl/Util/SSH2MP.pm:6
Los problemas parecen estar relacionados con los modulos "Net::SSH::Perl::Util::SSH2MP::mp2b", "/Crypt/DH" y "Math::BigInt"...
La salida de un strace, muestra:
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183
open("/dev/random", O_RDONLY|O_LARGEFILE) = 4
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfbd7478) = -1 EINVAL (Invalid argument)
_llseek(4, 0, [0], SEEK_CUR) = 0
fstat64(4, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, , ...}) = 0
fcntl64(4, F_SETFD, FD_CLOEXEC) = 0
read(4, "yR\301\362\244\354?2v\227\24\234\6\340\316F", 21) = 16
read(4,
Muchisimas llamadas del tipo "times({tms_utime=421, tms_stime=104, tms_cutime=0, tms_cstime=0}) = -1320043183 " y se queda esperando varios segundos en este read():
open("/dev/random", O_RDONLY|O_LARGEFILE) = 4
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfbd7478) = -1 EINVAL (Invalid argument)
_llseek(4, 0, [0], SEEK_CUR) = 0
fstat64(4, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, Cool, ...}) = 0
fcntl64(4, F_SETFD, FD_CLOEXEC) = 0
read(4, "yR\301\362\244\354?2v\227\24\234\6\340\316F", 21) = 16
read(4,
¿A alguien le ha pasado esto? He visto que alguno por aquí utillizais este modulo y quizás habeis dado con la solución si os ha pasado lo mismo..
¡Gracias!