How to deal with the slow access speed of GitHub


githubIt is the most popular open source project hosting platform in the world. Its open source culture has fundamentally changed the way of software development.

Basically, all requirements can be met fromgithubMore or less to find a ready-made implementation, no longer need to start building wheels but custom wheels!

However, sometimes domestic visits to are too slow. How to speed up the visitgithub.comWebsite became just need.

Becausegithub.comThe website is located in San Francisco, so the initial visitgithub.comNetwork addressing takes time, which is one of the reasons why websites open slowly.

Foreign online testing website:

Initial user input from browsergithub.comAt the time of web address, the browser does not know the reality of the domain name.ipAddress, first ask your computer if you know the number of the domain name. If you don’t know the local operator, you will continue to ask the superior until you know the name.github.comOur house number is192.30.253.113Until!

Such a tedious process of asking for directions is calledDNSAddressing, if the time of asking for directions takes a long time, then the speed of visiting the website will be very slow.

Therefore, if we directly tell the browser destination, the browser will not bother to ask the way step by step, which to some extent optimizes the speed of visiting the website.

$ ping -c 3
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=41 time=405.924 ms
64 bytes from icmp_seq=1 ttl=41 time=346.654 ms
64 bytes from icmp_seq=2 ttl=41 time=345.485 ms

--- ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 345.485/366.021/405.924/28.220 ms

ping -c 3Seegithub.comThe house number of the website

Normally, there will be multiple subdomains under the main domain name of the website, which will be combined to provide complete services.

andgithub.comNo exception, includinggithub.comIt is a primary domain name and also a primary domain name. Other domain names are basically secondary Yu Min or sub domain names.

So we’re not just going to tell this machinegithub.comThe main domain name, but also the relevant sub domain name also tell this machine, help people to the end, send the blessing to the West!

Where can I find the domain name andipWhat about the corresponding relationship?

Think about real life, everyone has their own home, and this home has a specific address, which is usually called the house number.

Of course, some people have not only one home, but also many properties.

Corresponding to the computer world, domain name is the personal user in the computer, and the home of domain name is the IP address. A domain name can have multiple IPS, but an IP can only have one domain name.

The so-called “one mountain can’t allow two tigers” and “how can we let others sleep next to our couch”? There can only be one head of our family!

If someone wants to visit you, they must have a specific address to visit your home. The process from your home to your home address may be that you told him or that he himself sought information from others.

Domain name toipThe address process also needs to be inquired. This information usually exists.dnsService providers there, just like our address registered to the relevant government agencies.

Although the information of relevant organizations is authoritative and timely, the threshold is a little high. It’s better to ask the local “news link”.

On the Internet, “newscom” is more numerous, here recommend two query domain name resolution site.



What are the subdomains

Below isipaddress.comFor example, querygithub.comInformation about the website.

Enter in the input boxgithub.comAfter the domain name, start to resolve the information related to the domain name, and not only find the correspondingipThe address also inquires the domain name information of the related website.

Experience it personally: domain name query

According to the relevant domain name information found, find out the correspondingipAddress, so sort out the following content.

# github related website

Nearby CDN acceleration

Large web servers are not only one server, but a cluster of servers to provide services.

Used all over the worldgithubIf every time you visit the website, you go to the U.S. server. Even if the browser knows the destination, it will be very slow if it is too far away.

Therefore, if you can visit nearbygithubThe website can greatly improve the visiting speed. Fortunately, there are also ready-made tools on the Internet to help us check the nearest website address.

Experience it yourself: DNS query

From the above figure, we can see that there are many differences in the same domain name.ipAddress, select fromTTLThe minimum value is used as the optimization standard.

Therefore, the above list continues to be optimized as follows:

# github related website

It’s best to test the nearest site in person for the best experience, but guess it’s not very different, so it’s OK to copy directly.

Tell local new address

Now we’ve figured out the domain name andipThe next thing we need to do is to tell the local computer that different operating systems may store different addresses for specific files.WindowsandMacGive an example.

# github related website


The mapping file is stored in:C:\Windows\System32\drivers\etc\hosts

  • openhostsFile, mapping the aboveAppendTo the end of the file, save and exit.

If you are unable to save due to insufficient permissions, you can copy to the desktop, edit the file, move and replace it tohostsDocuments.

  • Functionipconfig /flushdnsRefreshdnsCache.


The mapping file is stored in:/etc/hosts

  • edithostsFile and append the above mapping relationship.
$ cat /etc/hosts
# jetbrains

# github related website
  • Functionsudo dscacheutil -flushcacheRefreshdnsCache.
$ ping -c 3
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=41 time=395.808 ms
64 bytes from icmp_seq=1 ttl=41 time=306.919 ms
64 bytes from icmp_seq=2 ttl=41 time=298.188 ms

--- ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 298.188/333.638/395.808/44.105 ms

Time to summarize

This article describes how to solvegithub.comThe problem of slow access to the website can be solved by modifying thehostsFile to bypassdnsParsing, this method is only applicable to the phenomenon that it is only slow to visit the website.

If you can’t access foreign websites, this method is not applicable, and you may need to find another way!

Recommended Today

Query SAP multiple database table sizes

Query SAP multiple database table sizes Item code db02 Here are two approaches, In the first graphical interface, the results of the query data table are displayed in MB, and only one table can be queried at a time. SPACE—Segments—Detailed Analysis—Detailed Analysis  In the pop-up window segment / object, enter the name of the […]