DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Trending

  • Deploy a Session Recording Solution Using Ansible and Audit Your Bastion Host
  • Exploring Sorting Algorithms: A Comprehensive Guide
  • Podman Desktop Review
  • How To Deploy Helidon Application to Kubernetes With Kubernetes Maven Plugin

Raven DB 3.5: Fine Grained Work Control

With Raven DB 3.5, we've brought an improved RavenThreadPool (RTP) including better and faster indexing to better handle the unique needs of RavenDB.

Oren Eini user avatar by
Oren Eini
·
Apr. 27, 15 · Interview
Like (0)
Save
Tweet
Share
2.88K Views

Join the DZone community and get the full member experience.

Join For Free

with ravendb 3.5, we are focusing on performance as one of the key features. i’ve already spoken at length about the kind of changes that we had made to improve performance. a few percentage points here and there end up being quite significant when you add them all together.

but just sanding over the rough edges isn’t quite enough for us. we want to have a major impact, not just an avalanche of small improvements. in order to handle that, we needed to be much more aware of how we are making use of resources in the system.

the result of several months of work is now ready to enter into performance testing, and i’m quite excited about it. but before i show you the results, what is it? well, ravendb does quite a lot in the background, to avoid holding up a request thread when you are calling ravendb. this mean that we have a lot of background work, indexing, map/reduce, etc.

we have been using the default .net thread pool for a long time to do that, and it has served us very well. but it is a generic construct, without awareness of the unique needs that ravendb has. therefore, we worked for quite some time to create our own thread pool that match what we do.

the major changes with the raventhreadpool (rtp from now) are:

  • there is a fixed (and dedicated) number of threads that will do the work, sharing (and stealing) work among themselves.
  • indexes tasks are continuous and shared, so a big indexing work will spread across all threads, but with a preference for locality of work if we have a lot of stuff to parallel.
  • a slow index doesn’t stop us from working on other indexes, we’ll let it process on its own, and let the other indexes run forward without it.
  • dynamic adjusting of the amount of work that is allowed for the indexes means that under load, we can dynamically and rapidly reduce the amount of work we are doing to allow more resources for processing requests.

there are other stuff, but they are mostly of interest for the people who work on ravendb, not on those who use it.

and the results, they are pretty good. here is the before and after sample.

image

note that we have a mix here of various types of indexes. the x axis is time, and the y axis is the number of documents indexed.

as you can see, in the before (without rtp), we are processing all indexes roughly on the same course, with a pretty flat growth over time.  however, with rtp, the situation is different. you can see that very quickly the fast indexes are starting to outpace both their version without rtp and the slower indexes.

that, in turn, means that they complete much faster. in the case of the simple map index, it complete indexing roughly 50% faster than without rtp. but even more interesting is what happens globally, because we are able to complete indexing of the fast indexing fast, it means that we can process the slow index (heavymapreduce) with more resources. so even this slowpoke completes about 15% faster with rtp than without it.

we are still running tests, but even so, this is quite exciting.

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.


Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: