Skip to content

Commit 890db58

Browse files
authored
Update README.md - section on performance
1 parent 90b9f04 commit 890db58

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,36 @@ Use the Django admin interface to monitor and manage the goals.
276276

277277
In this example, we created a simple task to send a follow-up email to customers who haven't completed their purchase. We used Django Goals to schedule this task to run after 24 hours, defined the logic for sending the email in a handler function, and integrated the scheduling into our application logic. Finally, we ran the worker to process the goals and used the Django admin interface to monitor and manage them.
278278

279-
### More design info
279+
## Performance
280+
281+
### Production Scale Experience
282+
283+
Django Goals has been successfully deployed in production environments with the following characteristics:
284+
285+
- **Verified Worker Scale**: Tested with 48 concurrent workers (12 Heroku 1x pro dynos × 4 workers)
286+
- **Database Performance**: Operates smoothly on Heroku standard-0 PostgreSQL plan under this load
287+
- **Scalability Potential**: Based on database performance metrics, the system is estimated to handle up to ~150 concurrent workers without significant degradation
288+
289+
### Database Optimization
290+
291+
The system is designed with database performance in mind:
292+
293+
- Optimized database layout with indexes for all state transitions
294+
- No full table scans during standard operations
295+
- Uses PostgreSQL's SKIP LOCKED feature to maintain responsiveness even under load
296+
- Each worker requires one database connection, which is typically the main bottleneck
297+
298+
### Task Duration Considerations
299+
300+
While the system is optimized for shorter tasks, it can handle longer-running tasks with some considerations:
301+
302+
- Recommended: Tasks that complete within seconds to minutes
303+
- Possible: Tasks running up to 10 minutes have been successfully used in production
304+
- System remains responsive during long-running tasks due to:
305+
- Goal-level locking (rather than table-level)
306+
- SKIP LOCKED query optimization for concurrent goal processing
307+
308+
## More design info
280309

281310
A single task/goal can be executed in many "pieces". For example, the handler function can dynamically decide to terminate the execution and request processing at a later date. Preconditions can be modified in each execution. In other words, a worker may pursue the goal in many tries and modify preconditions in each try.
282311

0 commit comments

Comments
 (0)