Skip to content

Commit e1b4219

Browse files
committed
Use HTTP/1.1
- Order of magnitude reduction in TCP sockets and Python threads - Small improvement on overall page loading time
1 parent a34fc2d commit e1b4219

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: tensorboard/main.py

+7
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,13 @@ def main(unused_argv=None):
261261
efi.inspect(FLAGS.logdir, event_file, FLAGS.tag)
262262
return 0
263263
else:
264+
265+
# The default is HTTP/1.0 for some strange reason. If we don't use
266+
# HTTP/1.1 then a new TCP socket and Python thread is created for
267+
# each HTTP request. The tradeoff is we must always specify the
268+
# Content-Length header, or do chunked encoding for streaming.
269+
serving.WSGIRequestHandler.protocol_version = 'HTTP/1.1'
270+
264271
plugins = [
265272
core_plugin.CorePlugin,
266273
scalars_plugin.ScalarsPlugin,

0 commit comments

Comments
 (0)