# I wonder how much cpu share each Workload Prioritization type (oltp, olap) of scylladb has

**URL:** <https://forum.scylladb.com/t/i-wonder-how-much-cpu-share-each-workload-prioritization-type-oltp-olap-of-scylladb-has/121>\
**Category:** ScyllaDB\
**Tags:** api, workload-prioritizat\
**Created:** [November 30, 2022, 4:24pm UTC](https://forum.scylladb.com/t/i-wonder-how-much-cpu-share-each-workload-prioritization-type-oltp-olap-of-scylladb-has/121 "2022-11-30T16:24:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stewart\_Han](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/stewart_han/32/75_2.png) [@Stewart\_Han](https://forum.scylladb.com/u/Stewart_Han)\
**Post date:** [November 30, 2022, 4:24pm UTC](https://forum.scylladb.com/t/i-wonder-how-much-cpu-share-each-workload-prioritization-type-oltp-olap-of-scylladb-has/121/1 "2022-11-30T16:24:41Z")

</div>

> <https://github.com/scylladb/scylladb/blob/master/docs/dev/service_levels.md>

There are two workload types in scylladb other than the default value, but it doesn’t seem to be specified in the documentation how much cpu share this option has.

```auto
interactive - workload sensitive to latency, expected to have high/unbounded concurrency, with dynamic characteristics, 

OLTP; example: users clicking on a website and generating events with their clicks batch - workload for processing large amounts of data, not sensitive to latency, expected to have fixed concurrency, 

OLAP, ETL; example: processing billions of historical sales records to generate useful statistics

```

Even if I check the related PR, it is not specified how much cpu share the corresponding workload type takes.  
May I know the relevant code?

---

<div class="post-metadata">

**Author:** ![eliransin](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/eliransin/32/78_2.png) [@eliransin](https://forum.scylladb.com/u/eliransin)\
**Post date:** [December 4, 2022, 11:26am UTC](https://forum.scylladb.com/t/i-wonder-how-much-cpu-share-each-workload-prioritization-type-oltp-olap-of-scylladb-has/121/2 "2022-12-04T11:26:26Z")

</div>

Hi @Stewart_Han ,  
It is not about cpu shares, the workload type is used by ScyllaDB to decide on the proper action during  
excesive load on the system.  
For `batch` workloads , where the concurrency is bounded, we can throttle the load by delaying  
answers to the client, this in turn will make him send less requests per second for each thread.  
For `interactive` workload, throteling doesn’t make much sense since the requests are not queued on  
the client side so the only resort is to fail early and signal to the client that we are overloaded (OverloadedException), this behaviour is a little bit speculative since we need to predict in advance our ability to serve a specific requests withing the timeout limits.

Here is a pointer to the code where we drop requests for interactive workload if we predict that we will  
not be able to meet the timeout:

> <https://github.com/scylladb/scylladb/blob/b551cd254c6daf07014267950fcdd17aaf19acf0/transport/server.cc#L590-L598>

If the workload is not interactive scylla will just continue normally, assuming that the workload will converge to the maximal throughput possible.

---

<div class="post-metadata">

**Author:** ![Stewart\_Han](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/stewart_han/32/75_2.png) [@Stewart\_Han](https://forum.scylladb.com/u/Stewart_Han)\
**Post date:** [December 14, 2022, 5:34am UTC](https://forum.scylladb.com/t/i-wonder-how-much-cpu-share-each-workload-prioritization-type-oltp-olap-of-scylladb-has/121/3 "2022-12-14T05:34:02Z")

</div>

thanks for your reply!
