What if the response speed is slow after the project is deployed to the server ?, Slow deployment
A simple project is to call an API to query the express delivery information. When running locally, the response time is the slowest, that is, several hundred milliseconds. However, deploying a project on the server becomes several seconds. What is strange is that it is slow. After an afternoon, I checked the server network, configuration, and other reasons. At last, an error is reported when the server is started.
Caused by: java.net. unknownHostException: centos6: Unknown name or service at java.net. inet6AddressImpl. lookupAllHostAddr (Native Method) at java.net. inetAddress $2. lookupAllHostAddr (InetAddress. java: 928) at java.net. inetAddress. getAddressesFromNameService (InetAddress. java: 1323) at java.net. inetAddress. getLocalHost (InetAddress. java: 1500)
This error has never been encountered before, but it seems to be related to the network. So I figured out whether the slow speed was related to this error and solved it by the way.
Specific solution:
Modify the etc/hosts file: Add host name ing
The host name is the name following @ in front of the linux Command.
After the problem is solved, the above error will not be reported when tomact is started. What's amazing is that the response speed of the Project is getting faster. Although I don't know what the principle is, I can decide on this issue.