真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

域名解析導致數(shù)據(jù)庫連接緩慢(hosts:filesdns)

因域名解析導致數(shù)據(jù)庫連接延遲分析

十年的恭城網(wǎng)站建設(shè)經(jīng)驗,針對設(shè)計、前端、開發(fā)、售后、文案、推廣等六對一服務,響應快,48小時及時工作處理。全網(wǎng)整合營銷推廣的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動調(diào)整恭城建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計,從而大程度地提升瀏覽體驗。成都創(chuàng)新互聯(lián)從事“恭城網(wǎng)站設(shè)計”,“恭城網(wǎng)站推廣”以來,每個客戶項目都認真落實執(zhí)行。

一、現(xiàn)狀記錄

[oracle@node1 ~]$ /sbin/ifconfig
eth2      Link encap:Ethernet  HWaddr 00:25:90:04:AB:6B 
          inet addr:192.168.9.140  Bcast:192.168.15.255  Mask:255.255.248.0
          inet6 addr: fe80::225:90ff:fe04:ab6b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:23530402 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10959123 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:15308483748 (14.2 GiB)  TX bytes:10087987532 (9.3 GiB)
--IP地址為192.168.9.140
 
[oracle@node1 ~]$ more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               ecp-db localhost.localdomain localhost
192.168.9.140   node1.srtcloud.com
--域名node1.srtcloud.com對應ip192.168.9.140
 
[oracle@node1 ~]$ lsnrctl status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node1.srtcloud.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.5.0 - Production
Start Date                04-NOV-2011 09:08:51
Uptime                    21 days 4 hr. 58 min. 45 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /opt/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1.srtcloud.com)(PORT=1521)))
Services Summary...
Service "ecp" has 2 instance(s).
  Instance "ecp", status UNKNOWN, has 1 handler(s) for this service...
  Instance "ecp", status READY, has 1 handler(s) for this service...
Service "ecpXDB" has 1 instance(s).
  Instance "ecp", status READY, has 1 handler(s) for this service...
Service "ecp_XPT" has 1 instance(s).
  Instance "ecp", status READY, has 1 handler(s) for this service...
Service "ora11g" has 2 instance(s).
  Instance "ora11g", status UNKNOWN, has 1 handler(s) for this service...
  Instance "ora11g", status READY, has 1 handler(s) for this service...
Service "ora11gXDB" has 1 instance(s).
  Instance "ora11g", status READY, has 1 handler(s) for this service...
The command completed successfully
--說明:ora11g是oracle 11g,ecp是oracle 10g
--當前使用域名node1.srtcloud.com監(jiān)聽
 
[oracle@node1 ~]$ more /opt/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
 
ECP =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = node1.srtcloud.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ecp)
    )
  )
 
ORA11G =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = node1.srtcloud.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ora11g)
    )
  )
--tns也通過域名訪問
 
[oracle@node1 ~]$ more /etc/resolv.conf
nameserver 211.155.235.201
nameserver 211.155.235.188
--當前有效的DNS服務器
 
[oracle@node1 ~]$ more /etc/nsswitch.conf |grep hosts:
hosts:     files dns
--域名解析順序

二、數(shù)據(jù)庫正常工作分析
1、tns工作:客戶端通過tns訪問數(shù)據(jù)庫,tns配置的是域名訪問,所以需要解析,因為此刻解析的順序是先利用/etc/hosts解析,所以讀取hosts文件,獲取到ip,然后訪問對應數(shù)據(jù)庫,和監(jiān)聽接觸。
2、監(jiān)聽工作:監(jiān)聽的是域名,其實也是通過hosts解析成ip的
3、這里能夠正常的工作,是因為hosts文件解析了域名

三、模擬數(shù)據(jù)庫訪問延遲

[oracle@node1 ~]$ more /etc/nsswitch.conf |grep hosts:
hosts:     dns files
--先使用dns服務器解析,再使用hosts文件
 
[oracle@node1 ~]$ more /etc/resolv.conf
nameserver 11.1.1.1
--無效的dns服務器
 
[oracle@node1 ~]$ sqlplus chf/xifenfei@ora11g
 
SQL*Plus: Release 10.2.0.5.0 - Production on Fri Nov 25 14:44:55 2011
 
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
--會在這里一個很長的時間等待
 
[oracle@node1 ~]$ lsnrctl status
 
LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 25-NOV-2011 14:48:26
 
Copyright (c) 1991, 2010, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node1.srtcloud.com)(PORT=1521)))
--也會一個長時間的等待
 
--問題原因:就是因為解析域名的時候,先去訪問dns服務器,因為該ip非dns服務器ip,所以會一直等待該ip超時,
--然后訪問hosts文件獲取ip地址(這個就是為什么我們登錄或者查看監(jiān)聽狀態(tài)的時候,會出現(xiàn)如此長的時間的等待)

其實因為dns延遲的現(xiàn)象有很多種,我這里只是舉了一個最簡單,比較常見的例子,在處理因dns解析的監(jiān)聽延遲的問題上,可以參考下面幾點:
1、如果非特殊情況,盡可能使用ip地址在監(jiān)聽和tns中
2、如果是使用域名,請盡可能使用hosts解析,解析順序配置為files優(yōu)先(因為dns服務器有很多不確定,不可控因素)
3、如果一定要使用dns服務器解析,請把穩(wěn)定的dns服務器配置在第一項,盡可能避免出現(xiàn)dns服務器不可達或者不存在該域名的現(xiàn)象


文章名稱:域名解析導致數(shù)據(jù)庫連接緩慢(hosts:filesdns)
分享網(wǎng)址:http://weahome.cn/article/jesesi.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部