102 Commits

Author SHA1 Message Date
Riccardo Magliocchetti 752f5aada6 core/cache: remove ignored assignment
key_len value gets reassigned few lines below.
Reported by Coverity as CID #1231251
2015-05-05 15:14:26 +02:00
Riccardo Magliocchetti 9d70f39272 core/cache: avoid possible null dereference
The check at line 426 implies uc->name may be null.

Reported by Coverity as CId #990168
2015-01-14 22:12:31 +01:00
Unbit 7a2d5d9661 Merge remote-tracking branch 'origin/uwsgi-2.0-cache-lazy-expire' into uwsgi-2.0 2014-10-18 04:32:05 +02:00
Unbit ed2ca5d333 request buffer_size is now 64bit (except for uwsgi protocol) 2014-09-21 08:26:20 +02:00
Roberto De Ioris e5da0fc28c fix for #703, waiting for confirmation 2014-08-30 08:34:46 +02:00
Goir fadce6cfe5 add store_delete option to cache. This automatically removes invalid caches files 2014-08-17 10:39:32 +02:00
Unbit 6b9ce2d755 added test for lru cache purge and fix for lru removal 2014-05-27 11:38:57 +02:00
Yu Zhao 6aad281441 Add synonym "lru" for "purge_lru" in cache config 2014-04-22 07:17:53 -07:00
Yu Zhao 4f0e3fb79f Implement LRU for cache framework
If "purge_lru" option is used when creating cache store, the
"expires" parameter for cache_set/cache_update will be ignored.
Instead, all items are placed on an LRU list and when the store
is full, the least recent used one will be evicted.
2014-04-17 20:26:41 -07:00
Yu Zhao 149823aac4 Only scan cached items when there is expired one
This is an optimization for the sweeper algorithm. By remembering
the least expiration time, we can determine whether we need to go
over all items in a cache store. If we have to, we find the new
least expiration time by examining those that are not expired yet.
2014-04-15 13:57:57 -07:00
Yu Zhao 85d86dc10e Only allocate one sweeper thread
Thread is not cheap on Linux since it involves context switch in the
kernel. And allocating multiple threads is not necessary even on SMP
since the granularity of time is second.
2014-04-15 10:58:29 -07:00
Yu Zhao e97d921909 Optimization for sweeper creation loop
cache_no_expire is a global flag, if it's set, return without further
check when trying to create sweepers.
2014-04-15 08:56:34 -07:00
Łukasz Mierzwa 001e4b6e39 allow disabling cache warnings in --cache2 2014-04-01 20:00:13 +02:00
Unbit b3020e60f9 fixed long standing bug with caches 2014-02-20 14:19:40 +01:00
unbit e270593cc0 Merge pull request #533 from ramm/master
typo fix
2014-02-13 06:24:13 +01:00
Unbit c6c9baa7b5 initial test suite for bitmap cache mode 2014-02-12 18:54:39 +01:00
Danila Shtan 943c20b88c typo fix 2014-02-12 22:33:40 +05:00
Unbit a442614db0 fixed #531 2014-02-12 17:00:47 +01:00
Unbit 5830af37ba restore back needed_bytes 2014-02-12 16:25:02 +01:00
Danila Shtan 77f008e24c fix unmark interval inside cache_update 2014-02-12 18:20:39 +05:00
Danila Shtan df0bd832b4 bitmap allocation fix
fix cache_mark offset bug and change cache_unmark according to previous changes)
2014-02-12 17:36:40 +05:00
Danila Shtan 07c42c262f fix comment typos 2014-02-12 15:44:41 +05:00
Danila Shtan cb131836ae remove extra bit in bitmap_pos optimisation
looks like it was added because there was an error in counting last_byte_bit position in cache_mark_blocks()
2014-02-12 15:42:46 +05:00
Danila Shtan 2c6855a969 fix bitmap allocation 2014-02-12 15:37:44 +05:00
Roberto De Ioris 79ca1940de fixed #527 2014-02-12 06:59:24 +01:00
Roberto De Ioris d46879dca9 fixed #528 2014-02-12 06:33:47 +01:00
Unbit 61f3d162a4 getting rid og dynamic options (step 1) 2013-12-26 16:48:50 +01:00
Pavlo Kapyshin eeb203afd4 Fix typos 2013-11-16 17:41:26 +02:00
Unbit d7d0a71d87 completed rpc 64bit network client 2013-11-11 14:42:28 +01:00
Unbit 87b17c001d some typo 2013-09-26 05:32:27 +02:00
Unbit 67b7753814 use MAP_FAILED check for mmap() 2013-09-25 16:24:20 +02:00
Unbit 8918e81256 first attempt to change from strtok to strtok_r 2013-09-17 15:00:33 +02:00
Unbit ce8dd001bf ported uwsgi.cache_keys to pypy 2013-08-23 11:06:24 +02:00
Unbit d4e90f5215 added uwsgi.cache_keys function api 2013-08-23 10:43:13 +02:00
Unbit 294452eef7 added support for retry in http router 2013-06-25 07:56:01 +02:00
Unbit 8f19fe292e added --add-cache-item 2013-06-20 15:12:48 +02:00
Unbit ea1f239807 added memory offload 2013-05-25 20:01:26 +02:00
Unbit 9323ca5136 added cache math api to python 2013-05-08 10:34:34 +02:00
Unbit 978e6072ab prepare for math operations in cache 2013-05-08 09:41:24 +02:00
Łukasz Mierzwa 11c5429184 fixed cache sync parsing - uwsgi_hooked_parse() was getting invalid data lenght 2013-04-25 14:28:18 +02:00
Unbit 068024134c added --load-file-in-cache-gzip 2013-04-17 16:08:27 +02:00
Unbit 538ab57b6e extend magic cache api to export the expires value (if available) 2013-04-16 18:56:25 +02:00
Unbit 8ed8f46374 fixed some minor-bug dected by cppcheck 2013-04-15 13:45:46 +02:00
Łukasz Mierzwa 30abcb2563 store cache last modification time if enabled, fixes #224 2013-04-12 22:11:25 +02:00
Łukasz Mierzwa 53679879ca cache refactoring for better plugin friendliness 2013-04-09 14:15:33 +02:00
Łukasz Mierzwa 8a89b49df1 update cache items count after restore 2013-03-28 23:20:17 +01:00
Unbit 619e853a19 cache sync is working again 2013-03-09 06:34:48 +01:00
Unbit 4ad9c8d034 fixed default cache set 2013-03-08 20:00:25 +01:00
Unbit a684bc6124 completed magic cache clear 2013-03-08 17:21:08 +01:00
Unbit 849ba0856f implemented cache magic exists and del 2013-03-08 17:04:36 +01:00