0

I built the boost 1.81.0 library, then compiled boost::beast on Linux Ubuntu 22.04 with c++20 (cxxstd 2a). out of this library I wish to learn how to work with 100% (almost) CPU-s on multiple web-sockets.

can you help me innovate/modify the code to prepare an example that utilize multiple web-sockets that use 100% of the cpu?

i have simple client:

okatz@okatz2015:~/Public/boost/boost_1_81_0/bin.v2/libs/beast/example/websocket/client/awaitable/gcc-11/debug/cxxstd-2a-iso/threading-multi/visibility-hidden$ ./websocket-client-awaitable localhost 8080 "Hello, world!"
Hello, world!

Thanks Ori Kovacsi Katz

process #1
(pyjwt) okatz@okatz2015:~/Public/boost/boost_1_81_0$ ^C
(pyjwt) okatz@okatz2015:~/Public/boost/boost_1_81_0$ sudo ./bin.v2/libs/beast/example/advanced/server-flex-awaitable/gcc-11/debug/cxxstd-2a-iso/threading-multi/visibility-hidden/advanced-server-flex-awaitable 0.0.0.0 8080 . 1
[sudo] password for okatz: *****


process #2okatz@okatz2015:~/Public/boost/boost_1_81_0/bin.v2/libs/beast/example/websocket/client/awaitable/gcc-11/debug/cxxstd-2a-iso/threading-multi/visibility-hidden$ ./websocket-client-awaitable localhost 8080 "Hello, world!"
Hello, world!
sehe
  • 374,641
  • 47
  • 450
  • 633
  • what are you trying to achieve? As long as your task is IO-bound "using 100% CPU" is just killing the environment for no reason. Your task is IO bound. – sehe Nov 13 '22 at 21:37
  • I wish to utilize a server dedicated for streaming data in to a set of SSD drives distributed on the cloud / on computers hub. it's only purpose is to save data, there is no need for any peripheral software processes. I even not sure this server will handle reading from disks. – Ori Kovacsi-Katz Nov 14 '22 at 12:52
  • Then it will certainly never use 100% CPU (unless you're just willingly wasting energy) – sehe Nov 14 '22 at 15:18
  • it's intended for huge concern in the Data Storage industry. millions of customers (clients) with scalable access. whenever one of the unit will be saturated to 100% will deploy a new one to cover the load. – Ori Kovacsi-Katz Nov 15 '22 at 09:31
  • Without detailed specs of the hardware we can't consult. Since you have millions of clients, you should probably hire that consultant. From the given scenario, I still maintain that striving for 100% CPU is a phantom goal. I've seen beefy server with lots of storage over e.g. infiniband, and yes efficiency would matter, but that's an entirely different question (more about latency/throughput/concurrency than about CPU saturation; also storage configuration will be integral to the planning, because it dictates concurrency requirements) – sehe Nov 15 '22 at 12:44
  • can't hire anyone I am a candidate to a position at dell – Ori Kovacsi-Katz Nov 16 '22 at 13:09

0 Answers0