aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/cache
Commit message (Collapse)AuthorAgeFilesLines
* jupiter code cleanup (#276)Dan Engelbrecht2025-01-221-1/+1
| | | | | | | * cleanup jupiter * move jupiter files to separate folder * CloudCache -> Jupiter * split up jupiter files * kill redundant JupiterAccessTokenProvider
* move basicfile.h/cpp -> zencore (#273)Dan Engelbrecht2025-01-161-2/+2
| | | | | | move jupiter.h/cpp -> zenutil move packageformat.h/.cpp -> zenhttp zenutil now depends on zenhttp instead of the inverse
* Memory tracking improvements (#262)Stefan Boberg2024-12-111-0/+4
| | | | | * added LLM tag to properly tag RPC allocations * annotated some more httpsys functions with memory tags * only emit memory scope events if the active tag is different from the new tag
* global open process cache for projectstore (#257)Dan Engelbrecht2024-12-052-3/+6
| | | | * move openprocess cache to central location * enable openprocesscache in projectstore so "getchunks" can send filehandles when requested
* added support for dynamic LLM tags (#245)Stefan Boberg2024-12-021-0/+13
| | | | | * added FLLMTag which can be used to register memory tags outside of core * changed `UE_MEMSCOPE` -> `ZEN_MEMSCOPE` for consistency * instrumented some subsystems with dynamic tags
* caller controls threshold for bulk-loading chunks in IterateChunks (#222)Dan Engelbrecht2024-11-251-2/+4
| | | | | | * Allow caller to control threshold for bulk-loading chunks in IterateChunks * use smaller batch chunk reading for /fileinfos and /chunkinfos as we do not intend to read the payload * use smaller batch read buffer when just querying for size of attachments
* bucket size queries (#203)Dan Engelbrecht2024-10-211-0/+115
| | | - Feature: Added options --bucketsize and --bucketsizes to zen cache-info to get data sizes in cache buckets and attachments
* Added namespace qualifier (optional) for z$ rpc requests (#166)Stefan Boberg2024-09-232-52/+75
| | | This change adds support for a namespace-qualified RPC endpoint for z$ at `/z$/<namespace>/$rpc` which may be used to validate RPC requests by URL inspection. The old scheme is still supported.
* cache optimizations (#88)Dan Engelbrecht2024-05-301-1/+1
| | | | | * message formatting optimizations * bump iostorecompression small value threshold to 1MB
* fix zero size attachment replies (#69)Dan Engelbrecht2024-05-021-1/+9
| | | | - Bugfix: Don't try to respond with zero size partial cache value when partial size is zero - Improvement: Added more validation of data read from cache / cas
* batch cache put (#67)Dan Engelbrecht2024-05-021-5/+11
| | | - Improvement: Batch scope for put of cache values
* InsertChunks for CAS store (#55)Dan Engelbrecht2024-04-221-30/+47
| | | - Improvement: Add batching when writing multiple small chunks to block store - decreases I/O load significantly on oplog import
* clean up test linking (#4)Dan Engelbrecht2024-03-142-280/+2
| | | | | | | - Improvement: Add zenhttp-test and zenutil-test - Improvement: Moved cachepolicy test to cachepolicy.cpp - Improvement: Renamed cachestore tests from z$ to cachestore - Improvement: Moved test linking so test for a lib is linked by <lib>-test - Improvement: Removed HttpRequestParseRelativeUri in httpstructuredcache.cpp and use the one in cacherequests.h instead
* remove reference caching (#658)Dan Engelbrecht2024-02-271-1/+0
| | | * remove reference caching
* changed RPC recording to MPSC setup (#638)Stefan Boberg2024-01-311-21/+1
| | | fixes rare race condition when using RPC recording for long periods of time
* separate RPC processing from HTTP processing (#626)Stefan Boberg2023-12-202-1654/+40
| | | | | | * moved all RPC processing from HttpStructuredCacheService into separate CacheRpcHandler class in zenstore * move package marshaling to zenutil. was previously in zenhttp/httpshared but it's useful in other contexts as well where we don't want to depend on zenhttp * introduced UpstreamCacheClient, this provides a subset of functions on UpstreamCache and lives in zenstore
* move cachedisklayer and structuredcachestore into zenstore (#624)Stefan Boberg2023-12-196-7692/+1
|
* fix ChunkIndexToChunkHash indexing (#621)Stefan Boberg2023-12-191-1/+1
| | | would previously index into a reserved-but-not-sized vector which is bad but not crash-inducing bad
* cache RPC recorder threading fixes (#617)Stefan Boberg2023-12-192-15/+62
| | | | | * ensure all access to m_Entries is done while holding lock * RPC recorder concurrency fixes - setup/teardown of recorder needs to be done while holding an exclusive lock. Calls into recorder should be done while holding a shared lock.
* Don't use copy of Payloads array when fetching memcached payload in GC (#609)Dan Engelbrecht2023-12-131-1/+1
| | | * Don't use copy of Payloads array when fetching memcached payload in GC
* improve trace (#606)Dan Engelbrecht2023-12-131-34/+53
| | | | | * Adding some more trace scopes for better visiblity * Removed spammy trace scope when replaying oplogs * Remove "::Disk" from trace scopes - redundant now that we have merge disk and memory layers
* mem cache perf improvements (#592)Dan Engelbrecht2023-12-112-120/+168
| | | | | | | | - Improvement: Refactor memory cache for faster trimming and correct trim reporting - Improvement: Added trace scopes for memory cache trimming Adding a link back to the cache item payload on the memory cache item allows us to iterate over only the items cached in memory instead of over the entire index. This also allows us to do efficient compact of the memory cache array when trimming. It adds 4 bytes of overhead to each item cached in memory.
* fix deadlock at bucket creation (#598)Dan Engelbrecht2023-12-112-177/+205
| | | | | | - Make sure we don't hold the namespace bucket lock when we create buckets to avoid deadlock - Pass lock scope to helper functions to clarify locking rules - Block flush and gc operations for a bucket that is not yet initialized - Add ZenCacheDiskLayer::GetOrCreateBucket to avoid code duplication
* Use correct iterator index when looking up memcached payload in ↵Dan Engelbrecht2023-12-051-5/+4
| | | | | GatherReferences (#591) * Use correct iterator index when looking up memcached payload in gatherreferences
* reserve vectors in gcv2 upfront / load factor for robin_map (#582)Dan Engelbrecht2023-12-041-5/+20
| | | | | * reserve vectors in gcv2 upfront * set max load factor for robin_map indexes to reduce memory usage * set min load factor for robin_map indexes to allow them to shrink
* memory usage estimation for memcached entries (#586)Dan Engelbrecht2023-12-041-5/+24
| | | | * do a more accurate memory usage estimation for memcached entries * early exit when checking memcache usage
* use 32 bit offset and size in BlockStoreLocation (#581)Dan Engelbrecht2023-12-012-41/+78
| | | - Improvement: Reduce memory usage in GC and diskbucket flush
* add separate PreCache step for GcReferenceChecker (#578)Dan Engelbrecht2023-12-013-203/+381
| | | | | | - Improvement: GCv2: Use separate PreCache step to improve concurrency when checking references - Improvement: GCv2: Improved verbose logging - Improvement: GCv2: Sort chunks to read by block/offset when finding references - Improvement: GCv2: Exit as soon as no more unreferenced items are left
* global thread worker pools (#577)Dan Engelbrecht2023-11-291-10/+5
| | | - Improvement: Use two global worker thread pools instead of ad-hoc creation of worker pools
* tracing for gcv2 (#574)Dan Engelbrecht2023-11-281-0/+14
| | | | | | - Improvement: Added more trace scopes for GCv2 - Bugfix: Make sure we can override flags to "false" when running `zen gc` commmand - `smallobjects`, `skipcid`, `skipdelete`, `verbose`
* optimized index snapshot reading/writing (#561)Stefan Boberg2023-11-272-469/+800
| | | | | the previous implementation of in-memory index snapshots serialise data to memory before writing to disk and vice versa when reading. This leads to some memory spikes which end up pushing useful data out of system cache and also cause stalls on I/O operations. this change moves more code to a streaming serialisation approach which scales better from a memory usage perspective and also performs much better
* Add GC Cancel/Stop (#568)Dan Engelbrecht2023-11-241-11/+60
| | | | - GcScheduler will now cancel any running GC when it shuts down. - Old GC is rather limited in *when* it reacts to cancel of GC. GCv2 is more responsive.
* reduce work when there are no blocks to compact (#558)Dan Engelbrecht2023-11-221-54/+61
| | | | * reduce work when there are no blocks to compact * fix lock scopes
* add command line options for compact block threshold and gc verbose (#557)Dan Engelbrecht2023-11-211-5/+24
| | | | | | | | | | | - Feature: Added new options to zenserver for GC V2 - `--gc-compactblock-threshold` GCV2 - how much of a compact block should be used to skip compacting the block, default is 90% - `--gc-verbose` GCV2 - enable more verbose output when running a GC pass - Feature: Added new options to `zen gc` command for GC V2 - `--compactblockthreshold` GCV2 - how much of a compact block should be used to skip compacting the block, default is 90% - `--verbose` GCV2 - enable more verbose output when running a GC pass - Feature: Added new parameters for endpoint `admin/gc` (PUT) - `compactblockthreshold` GCV2 - how much of a compact block should be used to skip compacting the block, default is 90% - `verbose` GCV2 - enable more verbose output when running a GC pass
* compact separate for gc referencer (#533)Dan Engelbrecht2023-11-213-260/+352
| | | | | - Refactor GCV2 so GcReferencer::RemoveExpiredData returns a store compactor, moving out the actual disk work from deleting items in the index. - Refactor GCV2 GcResult to reuse GcCompactStoreStats and GcStats - Make Compacting of stores non-parallell to not eat all the disk I/O when running GC
* blocking queue fix (#550)Dan Engelbrecht2023-11-161-15/+28
| | | | | | | | | * make BlockingQueue::m_CompleteAdding non-atomic * ZenCacheDiskLayer::Flush logging * name worker threads in ZenCacheDiskLayer::DiscoverBuckets * name worker threads in gcv2 * improved logging in ZenServerInstance * scrub threadpool naming * remove waitpid handling, we should just call wait to kill zombie processes
* fix comparison operator for cache disk location (#534)Dan Engelbrecht2023-11-141-1/+12
| | | * proper != operator for DiskLocation
* fix index out of bounds in CacheBucket::CompactState (#532)Dan Engelbrecht2023-11-141-25/+24
| | | | | * use PayloadIndex for indexing into payload array * naming cleanup * fix metadata index in CacheBucket::CompactState
* fix potential logic error in bucket manifest readStefan Boberg2023-11-131-17/+21
|
* fix bad access to unlocked state (#527)Dan Engelbrecht2023-11-102-17/+26
| | | | * don't touch non-locked data when creating manifest * safety assert for test dir
* reduce memory footprint for bucket indexes (#526)Stefan Boberg2023-11-101-14/+14
| | | reduces memory footprint of cache index by 10% or so by limiting the maximum number of entries in a bucket to 2^32 (was 2^64)
* reduce number of files generated on shared instances (#524)Stefan Boberg2023-11-091-1/+3
|
* disk layer gc and error/warnings cleanup (#515)Dan Engelbrecht2023-11-082-36/+85
| | | | | | | - Improvement: Use GC reserve when writing index/manifest for a disk cache bucket when disk is low when available - Improvement: Demote errors to warning for issues that are not critical and we handle gracefully - Improvement: Treat more out of memory errors from windows as Out Of Memory errors Fixed wrong sizeof() statement for compactcas index (luckily the two structs are of same size)
* Don't put cache entries into the memory cache on Put, only on Get (#518)Dan Engelbrecht2023-11-072-21/+24
|
* spdlog implementation hiding (#498)Stefan Boberg2023-11-062-8/+5
| | | | | | | | | this change aims to hide logging internals from client code, in order to make it easier to extend and take more control over the logging process in the future. As a bonus side effect, the generated code is much tighter (net delta around 2.5% on the resulting executable which includes lots of thirdparty code) and should take less time to compile and link. Client usage via macros is pretty much unchanged. The main exposure client code had to spdlog internals before was the use of custom loggers per subsystem, where it would be common to have `spdlog::logger` references to keep a reference to a logger within a class. This is now replaced by `zen::LoggerRef` which currently simply encapsulates an actual `spdlog::logger` instance, but this is intended to be an implementation detail which will change in the future. The way the change works is that we now handle any formatting of log messages in the zencore logging subsystem instead of relying on `spdlog` to manage this. We use the `fmt` library to do the formatting which means the client usage is identical to using `spdlog`. The formatted message is then forwarded onto any sinks etc which are still implememted via `spdlog`.
* gc v2 tests (#512)Dan Engelbrecht2023-11-062-54/+10
| | | | | | | | | | * set MaxBlockCount at init * properly calculate total size * basic blockstore compact blocks test * correct detection of block swap * Use one implementation for CreateRandomBlob * reduce some data sets to increase speed of tests * reduce test time * rename BlockStoreCompactState::AddBlock -> BlockStoreCompactState::IncludeBlock
* statsd for cas (#511)Dan Engelbrecht2023-11-062-2/+2
| | | | * separate statsd interfaces so they can be accessible to zenstore * statsd for cas
* reduce cachebucket mem (#509)Dan Engelbrecht2023-11-062-293/+448
| | | | | | | * reduce memory footprint for disk cache separate dense arrays for rawhash+rawsize and memcache buffer * don't write RawHash/RawSize for buckets with no such metadata * helper functions * make index into metadata and cached payload type safe * helper functions for memcached
* multithread cache bucket (#508)Dan Engelbrecht2023-11-061-21/+66
| | | | * Multithread init and flush of cache bucket * tweaked threading cound for bucket discovery, disklayer flush and gc v2
* individual gc stats (#506)Dan Engelbrecht2023-10-303-160/+214
| | | | | - Feature: New parameter for endpoint `admin/gc` (GET) `details=true` which gives details stats on GC operation when using GC V2 - Feature: New options for zen command `gc-status` - `--details` that enables the detailed output from the last GC operation when using GC V2