Benjamin Zhang

目前就职于中科院计算机网络信息中心,主要兴趣集中在数据库,操作系统,中间件。

【Linux】telnet1521慢问题

07 Mar 2019 » SQLPLUS

telnet1521慢问题

  1. telnet分析命令

    [root@localhost ~]# strace telnet 172.17.0.103 1521
    execve("/usr/kerberos/bin/telnet", ["telnet", "172.17.0.103", "1521"], [/* 36 vars */]) = 0
    brk(0)                                  = 0x7f1b30153000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1b2f139000
    access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
    ("/etc/ld.so.cache", O_RDONLY)      = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=215808, ...}) = 0
    mmap(NULL, 215808, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f1b2f104000
    close(3)                                = 0
    open("/lib64/libkrb5.so.3", O_RDONLY)   = 3
    read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\265!\26:\0\0\0"..., 832) = 832
    fstat(3, {st_mode=S_IFREG|0755, st_size=948840, ...}) = 0
    mmap(NULL, 3041984, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1b2ea0d000
    mprotect(0x7f1b2eae9000, 2093056, PROT_NONE) = 0
    mmap(0x7f1b2ece8000, 49152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xdb000) = 0x7f1b2ece8000
    close(3)                                = 0
    open("/lib64/libk5crypto.so.3", O_RDONLY) = 3
    
  2. 把上述结果,生成日志temp.log ,进一步分析。

    [root@localhost ~]# cat temp.log |grep open
    open("/etc/ld.so.cache", O_RDONLY)      = 3
    open("/lib64/libkrb5.so.3", O_RDONLY)   = 3
    open("/lib64/libk5crypto.so.3", O_RDONLY) = 3
    open("/lib64/libcom_err.so.2", O_RDONLY) = 3
    open("/lib64/libtinfo.so.5", O_RDONLY)  = 3
    open("/lib64/libncurses.so.5", O_RDONLY) = 3
    open("/lib64/libc.so.6", O_RDONLY)      = 3
    open("/lib64/libkrb5support.so.0", O_RDONLY) = 3
    open("/lib64/libkeyutils.so.1", O_RDONLY) = 3
    open("/lib64/libresolv.so.2", O_RDONLY) = 3
    open("/lib64/libpthread.so.0", O_RDONLY) = 3
    open("/lib64/libdl.so.2", O_RDONLY)     = 3
    open("/lib64/libselinux.so.1", O_RDONLY) = 3
    open("/proc/filesystems", O_RDONLY)     = 3
    open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3
    open("/etc/ld.so.cache", O_RDONLY)      = 3
    open("/lib64/libnss_files.so.2", O_RDONLY) = 3
    open("/etc/resolv.conf", O_RDONLY)      = 3
    open("/etc/host.conf", O_RDONLY|O_CLOEXEC) = 3
    open("/etc/hosts", O_RDONLY|O_CLOEXEC)  = 3
    open("/etc/ld.so.cache", O_RDONLY)      = 3
    open("/lib64/libnss_dns.so.2", O_RDONLY) = 3
    open("/root/.telnetrc", O_RDONLY)       = -1 ENOENT (No such file or directory)
    open("/etc/krb5.conf", O_RDONLY)        = 4
    open("/dev/urandom", O_RDONLY)          = 4
    open("/dev/urandom", O_RDONLY)          = 4
    

    其中/etc/resolv.conf会进行反向解析。

    3.修改配置文件,/etc/resolv.conf

    [root@localhost ~]# vi /etc/resolv.conf 
    # Generated by NetworkManager
    search localdomain.localdomain
       
       
    # No nameservers found; try putting DNS servers into your
    # ifcfg files in /etc/sysconfig/network-scripts like so:
    #
    # DNS1=xxx.xxx.xxx.xxx
    # DNS2=xxx.xxx.xxx.xxx
    # DOMAIN=lab.foo.com bar.foo.com
    #nameserver 159.226.8.7
    

    然后telnet 1521,速度很快

    [root@localhost ~]# telnet 172.17.1.104 1521
    Trying 172.17.1.104...
    Connected to 172.17.1.104 (172.17.1.104).
    Escape character is '^]'.
    

Related Posts