Skip to content

ewwhite/ppro-shims

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ppro-shims

Performance shims and workarounds for Produce Pro and DBC legacy systems.

Overview

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.

Components

bin/last - Cached last command wrapper

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 last commands
  • 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/last

Uninstallation:

rm /usr/local/bin/last

How it works:

  1. First call runs /usr/bin/last and caches output to /tmp/.last_cache
  2. Cache refreshes every 60 seconds
  3. Subsequent calls grep from cache instead of scanning wtmp
  4. Appends dummy footer lines so | head -n -2 works correctly

Related Projects

  • readcache - LD_PRELOAD library for userspace ISAM read caching

Troubleshooting

Cache not refreshing

rm /tmp/.last_cache

Verify wrapper is being used

which last
# Should show: /usr/local/bin/last

# Test directly
/usr/local/bin/last testuser -n 1
/usr/bin/last testuser -n 1

Bypass wrapper temporarily

/usr/bin/last <args>

Contributing

When adding new shims:

  1. Document the problem (what's slow, why)
  2. Document the solution (how the shim works)
  3. Include installation/uninstallation instructions
  4. Include performance measurements (before/after)
  5. Ensure easy rollback

License

MIT License - See LICENSE file

Author

EW White Consulting (EWCS)
https://www.zfsexpress.com

About

Tools needed to keep things running

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages