Performance shims and workarounds for Produce Pro and DBC legacy systems.
Legacy ERP systems often contain inefficient patterns that can't be fixed without vendor involvement. This repository contains drop-in shims and wrappers that intercept problematic operations and optimize them without modifying application code.
Problem: Produce Pro's Linux User Management screen (WSUINQ) calls last <user> -n 1 for each user individually. With 150+ users and a 17MB wtmp file:
- 150 users × 0.46 seconds = 70+ seconds just for
lastcommands - Total screen load time: ~7 minutes
Solution: Cache the full last output on first call, grep from cache for subsequent calls.
Result: Screen load time reduced from 7 minutes to 10 seconds (42x improvement)
Installation:
cp bin/last /usr/local/bin/last
chmod +x /usr/local/bin/lastUninstallation:
rm /usr/local/bin/lastHow it works:
- First call runs
/usr/bin/lastand caches output to/tmp/.last_cache - Cache refreshes every 60 seconds
- Subsequent calls grep from cache instead of scanning wtmp
- Appends dummy footer lines so
| head -n -2works correctly
- readcache - LD_PRELOAD library for userspace ISAM read caching
rm /tmp/.last_cachewhich last
# Should show: /usr/local/bin/last
# Test directly
/usr/local/bin/last testuser -n 1
/usr/bin/last testuser -n 1/usr/bin/last <args>When adding new shims:
- Document the problem (what's slow, why)
- Document the solution (how the shim works)
- Include installation/uninstallation instructions
- Include performance measurements (before/after)
- Ensure easy rollback
MIT License - See LICENSE file
EW White Consulting (EWCS)
https://www.zfsexpress.com