l****6 发帖数: 10 | 1 假如你要写一个backend service,你怎么决定用多少threads来serve requests。两家
公司都问了这个题。
另外,线程,进程,以及connections怎么合作。 |
d******e 发帖数: 2265 | 2 标准答案不是#cpu_core+2嘛。
【在 l****6 的大作中提到】 : 假如你要写一个backend service,你怎么决定用多少threads来serve requests。两家 : 公司都问了这个题。 : 另外,线程,进程,以及connections怎么合作。
|
l****6 发帖数: 10 | 3 能解释一下吗?
【在 d******e 的大作中提到】 : 标准答案不是#cpu_core+2嘛。
|
a*******n 发帖数: 41 | 4 It depends on what kind of job you are going to run in backend, number of
cores, memory and disk access speed. You can create over 200 threads to run
small jobs but it is difficult to create 10 threads to do video encoding and
decoding. |
l****6 发帖数: 10 | 5 那给一个这种题,怎么回答。感觉它需要一个确定的答案。比如上面的cpu core + 2.
run
and
【在 a*******n 的大作中提到】 : It depends on what kind of job you are going to run in backend, number of : cores, memory and disk access speed. You can create over 200 threads to run : small jobs but it is difficult to create 10 threads to do video encoding and : decoding.
|
t*********3 发帖数: 4304 | 6 我这个EE的,会这样回答:先按照常规开若干线程,监控硬件利用率(CPU
,memory等等),然后根据性能表现来决定调整到一个合适的线程数量(例如10个线程
CPU 30%,20个线程40%,假设CPU 80%是安全上限,你可以开的上限是60个)。
2.
【在 l****6 的大作中提到】 : 那给一个这种题,怎么回答。感觉它需要一个确定的答案。比如上面的cpu core + 2. : : run : and
|
a*******n 发帖数: 41 | |
x***5 发帖数: 26 | 8 感觉是要做 performance testing,然后根据实际表现来吧。 |