For a requirement on which data needs to be displyed from the csv file (this may be updated at times) from dam folder on searching of ID from Which is having a14k records. Triggering a servlet on search and putting records into a Map and displaying it by below idMap.containsKey(id) and giving the response back. As if the request are getting more the server is getting high cpu. Any solution can be applied in this scenario.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @sudeepKonjeti ,
Is the csv file stored in AEM DAM and has around 14k rows, on which you are iterating to fetch a certain ID ?
Regards,
Anupam Patra
Hi @anupampat yes its is dam folder.
Views
Replies
Total Likes
Hi @sudeepKonjeti ,
As the number of requests increases, high CPU usage occurs due to repeated file parsing and object creation. You can follow the approach below to optimize access, improve scalability, and ensure fast responses.
1. Use In-Memory Cache (Guava Cache)
2. Implement Read-Write Lock
3. Use AEM Sling Scheduler for Cache Refresh
Regards,
HI @Shiv_Prakash_Patel thanks for your suggestion. But I can see the users are unique so every time new ID may be fetched in that case how much feasible this approach.
Views
Replies
Total Likes
To optimize performance and reduce CPU usage:
Use In-Memory Cache (e.g., Guava Cache) to store parsed CSV data, avoiding repeated file parsing on each request.
Implement Read-Write Lock to prevent concurrent cache updates.
Use AEM Sling Scheduler to automatically refresh the cache every 30 minutes or as needed.
This approach improves scalability and ensures faster responses.
there are three ways that you can use:
@sudeepKonjeti Did you find the suggestions helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Views
Likes
Replies