Tomcat is very slow when uploading files on localhost with HTTPS











up vote
0
down vote

favorite












Tomcat is very slow when uploading files on localhost with HTTPS



Host1:
IP: 192.168.9.13
VIP: 192.168.9.12
Service: nginx+keepalived,tomcat
Host2:
IP: 192.168.9.14
Service: nginx+keepalived,tomcat
Tomcat:
Http Port: 8080
Https Port: 8124
Nginx:
Https Port: 8443


nginx upstream use ip_hash



it is very slow when nginx and tomcat is same host, like this:



Client-----(https)----->Nginx-----(https)----->Tomcat
192.168.9.13 192.168.9.13


So, skip nginx to test upload file



Host1 192.168.9.13:



HTTP request:
$ time curl -X POST http://192.168.9.13:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.007s
sys 0m0.028s

$ time curl -X POST http://192.168.9.14:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.013s
sys 0m0.023s

HTTPS request
$ time curl -k -X POST http://192.168.9.13:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 4m18.691s
user 0m0.285s
sys 0m0.067s

$ time curl -k -X POST http://192.168.9.14:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.011s
sys 0m0.022s


Host2 192.168.9.14:



HTTP request:
$ time curl -X POST http://192.168.9.13:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.009s
sys 0m0.027s

$ time curl -X POST http://192.168.9.14:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.013s
sys 0m0.025s

HTTPS request
$ time curl -k -X POST http://192.168.9.13:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.010s
sys 0m0.027s

$ time curl -k -X POST http://192.168.9.14:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 4m32.329s
user 0m0.290s
sys 0m0.081s


According to the results, when Client or proxy is same host with tomcat server and tomcat use SSL, uploading file is very slow.



How can i to solve this problem?










share|improve this question







New contributor




21 BH4CXJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • You may have an slow SSL handshake. Capture packets with Wireshark and troubleshoot that.
    – Luis Muñoz
    Nov 8 at 15:09















up vote
0
down vote

favorite












Tomcat is very slow when uploading files on localhost with HTTPS



Host1:
IP: 192.168.9.13
VIP: 192.168.9.12
Service: nginx+keepalived,tomcat
Host2:
IP: 192.168.9.14
Service: nginx+keepalived,tomcat
Tomcat:
Http Port: 8080
Https Port: 8124
Nginx:
Https Port: 8443


nginx upstream use ip_hash



it is very slow when nginx and tomcat is same host, like this:



Client-----(https)----->Nginx-----(https)----->Tomcat
192.168.9.13 192.168.9.13


So, skip nginx to test upload file



Host1 192.168.9.13:



HTTP request:
$ time curl -X POST http://192.168.9.13:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.007s
sys 0m0.028s

$ time curl -X POST http://192.168.9.14:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.013s
sys 0m0.023s

HTTPS request
$ time curl -k -X POST http://192.168.9.13:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 4m18.691s
user 0m0.285s
sys 0m0.067s

$ time curl -k -X POST http://192.168.9.14:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.011s
sys 0m0.022s


Host2 192.168.9.14:



HTTP request:
$ time curl -X POST http://192.168.9.13:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.009s
sys 0m0.027s

$ time curl -X POST http://192.168.9.14:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.013s
sys 0m0.025s

HTTPS request
$ time curl -k -X POST http://192.168.9.13:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.010s
sys 0m0.027s

$ time curl -k -X POST http://192.168.9.14:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 4m32.329s
user 0m0.290s
sys 0m0.081s


According to the results, when Client or proxy is same host with tomcat server and tomcat use SSL, uploading file is very slow.



How can i to solve this problem?










share|improve this question







New contributor




21 BH4CXJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • You may have an slow SSL handshake. Capture packets with Wireshark and troubleshoot that.
    – Luis Muñoz
    Nov 8 at 15:09













up vote
0
down vote

favorite









up vote
0
down vote

favorite











Tomcat is very slow when uploading files on localhost with HTTPS



Host1:
IP: 192.168.9.13
VIP: 192.168.9.12
Service: nginx+keepalived,tomcat
Host2:
IP: 192.168.9.14
Service: nginx+keepalived,tomcat
Tomcat:
Http Port: 8080
Https Port: 8124
Nginx:
Https Port: 8443


nginx upstream use ip_hash



it is very slow when nginx and tomcat is same host, like this:



Client-----(https)----->Nginx-----(https)----->Tomcat
192.168.9.13 192.168.9.13


So, skip nginx to test upload file



Host1 192.168.9.13:



HTTP request:
$ time curl -X POST http://192.168.9.13:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.007s
sys 0m0.028s

$ time curl -X POST http://192.168.9.14:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.013s
sys 0m0.023s

HTTPS request
$ time curl -k -X POST http://192.168.9.13:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 4m18.691s
user 0m0.285s
sys 0m0.067s

$ time curl -k -X POST http://192.168.9.14:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.011s
sys 0m0.022s


Host2 192.168.9.14:



HTTP request:
$ time curl -X POST http://192.168.9.13:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.009s
sys 0m0.027s

$ time curl -X POST http://192.168.9.14:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.013s
sys 0m0.025s

HTTPS request
$ time curl -k -X POST http://192.168.9.13:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.010s
sys 0m0.027s

$ time curl -k -X POST http://192.168.9.14:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 4m32.329s
user 0m0.290s
sys 0m0.081s


According to the results, when Client or proxy is same host with tomcat server and tomcat use SSL, uploading file is very slow.



How can i to solve this problem?










share|improve this question







New contributor




21 BH4CXJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











Tomcat is very slow when uploading files on localhost with HTTPS



Host1:
IP: 192.168.9.13
VIP: 192.168.9.12
Service: nginx+keepalived,tomcat
Host2:
IP: 192.168.9.14
Service: nginx+keepalived,tomcat
Tomcat:
Http Port: 8080
Https Port: 8124
Nginx:
Https Port: 8443


nginx upstream use ip_hash



it is very slow when nginx and tomcat is same host, like this:



Client-----(https)----->Nginx-----(https)----->Tomcat
192.168.9.13 192.168.9.13


So, skip nginx to test upload file



Host1 192.168.9.13:



HTTP request:
$ time curl -X POST http://192.168.9.13:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.007s
sys 0m0.028s

$ time curl -X POST http://192.168.9.14:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.013s
sys 0m0.023s

HTTPS request
$ time curl -k -X POST http://192.168.9.13:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 4m18.691s
user 0m0.285s
sys 0m0.067s

$ time curl -k -X POST http://192.168.9.14:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.011s
sys 0m0.022s


Host2 192.168.9.14:



HTTP request:
$ time curl -X POST http://192.168.9.13:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.009s
sys 0m0.027s

$ time curl -X POST http://192.168.9.14:8080/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 0m0.430s
user 0m0.013s
sys 0m0.025s

HTTPS request
$ time curl -k -X POST http://192.168.9.13:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 9035cf1720554bb7a912fb208ebc4c1c"
real 0m0.430s
user 0m0.010s
sys 0m0.027s

$ time curl -k -X POST http://192.168.9.14:8124/secwechat/admin/app/upload -F "apk=@/home/temp/QQ_7.6.3.apk" -H "token: 25f3ad9323744c7aab00f53950369f0c"
real 4m32.329s
user 0m0.290s
sys 0m0.081s


According to the results, when Client or proxy is same host with tomcat server and tomcat use SSL, uploading file is very slow.



How can i to solve this problem?







performance tomcat https localhost






share|improve this question







New contributor




21 BH4CXJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




21 BH4CXJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




21 BH4CXJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 8 at 8:26









21 BH4CXJ

1




1




New contributor




21 BH4CXJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





21 BH4CXJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






21 BH4CXJ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • You may have an slow SSL handshake. Capture packets with Wireshark and troubleshoot that.
    – Luis Muñoz
    Nov 8 at 15:09


















  • You may have an slow SSL handshake. Capture packets with Wireshark and troubleshoot that.
    – Luis Muñoz
    Nov 8 at 15:09
















You may have an slow SSL handshake. Capture packets with Wireshark and troubleshoot that.
– Luis Muñoz
Nov 8 at 15:09




You may have an slow SSL handshake. Capture packets with Wireshark and troubleshoot that.
– Luis Muñoz
Nov 8 at 15:09

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






21 BH4CXJ is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203868%2ftomcat-is-very-slow-when-uploading-files-on-localhost-with-https%23new-answer', 'question_page');
}
);

Post as a guest





































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes








21 BH4CXJ is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















21 BH4CXJ is a new contributor. Be nice, and check out our Code of Conduct.













21 BH4CXJ is a new contributor. Be nice, and check out our Code of Conduct.












21 BH4CXJ is a new contributor. Be nice, and check out our Code of Conduct.















 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203868%2ftomcat-is-very-slow-when-uploading-files-on-localhost-with-https%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

Schultheiß

Liste der Kulturdenkmale in Wilsdruff

Android Play Services Check