Skip to content

Commit

Permalink
Set default worker to 1 (kubeflow#1106)
Browse files Browse the repository at this point in the history
KFServer uses the number of cores on the machine to set the number of process in its tornado service which can delay the initialization time and increase the memory usage a lot.

A local testing suggests that KFServer loaded 64 processes and used more than 500Mb for a simple SKLearn model. Once I set the worker number to 1, the memory usage was reduced to around 100Mb. 
```
[I 200927 18:26:06 kfserver:88] Registering model: mlguild-iris-svm
[I 200927 18:26:06 kfserver:77] Listening on port 8080
[I 200927 18:26:06 kfserver:79] Will fork 0 workers
[I 200927 18:26:06 process:126] Starting 64 processes
```
  • Loading branch information
yuzliu authored Sep 29, 2020
1 parent 7bc471c commit a0d9bd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/kfserving/kfserving/kfserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
help='The GRPC Port listened to by the model server.')
parser.add_argument('--max_buffer_size', default=DEFAULT_MAX_BUFFER_SIZE, type=int,
help='The max buffer size for tornado.')
parser.add_argument('--workers', default=0, type=int,
parser.add_argument('--workers', default=1, type=int,
help='The number of works to fork')
args, _ = parser.parse_known_args()

Expand Down

0 comments on commit a0d9bd2

Please sign in to comment.