This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*! | |
| * Cria um processo | |
| * \param name nome que sera dado ao novo processo | |
| * \param path caminho do executavel do processo | |
| * \param parametro parametros a serem passados para o executavel do processo | |
| * \param priority prioridade do processo (ou 0 para prioridade padrao) | |
| * \return 0 sucesso, processo criado | |
| * \return 1 erro, processo nao criado | |
| */ | |
| int BPMonitorProcessRestart(char* const name, char* const path, char* const parametros, const int priority) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| rate_limit.py | |
| Written May 7-8, 2014 by Josiah Carlson | |
| Released under the MIT license. | |
| Offers a simple interface for offering rate limiting on a per second, minute, | |
| hour, and day basis. Useful for offering varying rate limits depending on user | |
| behavior. Sliding window based limits offer per minute, hour, and day limits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local ts = tonumber(table.remove(ARGV)) | |
| local weight = tonumber(table.remove(ARGV)) | |
| local limit = tonumber(ARGV[1]) | |
| redis.call('zremrangebyscore', KEYS[1], 0, tonumber(ts) - 60) | |
| local curr = redis.call('zrangebyscore', KEYS[1], tonumber(ts), tonumber(ts)) | |
| redis.call('zremrangebyscore', KEYS[1], tonumber(ts), tonumber(ts)) | |
| redis.call('zadd', KEYS[1], ts, tonumber(curr[1] or '0') + tonumber(weight)) | |
| local all = redis.call('zrange', KEYS[1], 0, -1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [root@redis-lhv-01t ~]# while : ; do ps fawux | grep sentinel | grep -v grep; sleep 1; done | |
| root 56761 8.1 0.0 139812 8656 ? Ssl 11:53 0:02 redis-sentinel 172.30.104.126:26379 | |
| root 56761 8.2 0.0 139940 8768 ? Ssl 11:53 0:02 redis-sentinel 172.30.104.126:26379 | |
| root 56761 8.2 0.0 140068 8856 ? Ssl 11:53 0:02 redis-sentinel 172.30.104.126:26379 | |
| root 56761 8.3 0.0 140068 8956 ? Ssl 11:53 0:02 redis-sentinel 172.30.104.126:26379 | |
| root 56761 8.3 0.0 140196 9060 ? Ssl 11:53 0:02 redis-sentinel 172.30.104.126:26379 | |
| root 56761 8.3 0.0 140324 9136 ? Ssl 11:53 0:02 redis-sentinel 172.30.104.126:26379 | |
| root 56761 8.0 0.0 140452 9224 ? Ssl 11:53 0:02 redis-sentinel 172.30.104.126:26379 | |
| root 56761 8.1 0.0 140452 9320 ? Ssl 11:53 0:02 redis-sentinel 172.30.104.126:26379 | |
| root 56761 8.0 0.0 140580 9424 ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bind 172.30.104.126 | |
| port 26379 | |
| unixsocket "/var/run/redis_sentinel.sock" | |
| daemonize yes | |
| pidfile "/var/run/redis_sentinel.pid" | |
| logfile "/var/log/redis/redis_sentinel.log" | |
| loglevel notice | |
| timeout 240 | |
| sentinel monitor Group_4 172.30.104.126 60004 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O | |
| centauro-prod-1-3-score-8d6e68 0.00% 0 B / 0 B 0.00% 0 B / 0 B 0 B / 0 B | |
| dragon-03232016-street 5.80% 226.9 MB / 3.95 GB 5.74% 0 B / 0 B 50.63 MB / 16.38 kB | |
| dragon-chino-prod-1-3-score-03302016-score-8c292e 8.37% 236.3 MB / 3.95 GB 5.98% 0 B / 0 B 49.5 MB / 12.29 kB | |
| indexer-03232016-street 0.06% 253.7 MB / 3.95 GB 6.42% 574 kB / 152.8 kB 63.71 MB / 12.29 kB | |
| indexer-03302016-score 0.18% 242.6 MB / 3.95 GB 6.14% 137.3 kB / 151.9 kB 63.74 MB / 12.29 kB | |
| locations-monitor-prod 0.00% 70.93 MB / 3.95 GB 1.80% 43 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <strings.h> | |
| #include <sys/types.h> | |
| #include <unistd.h> | |
| #include <zlib.h> | |
| static long int uncompressedBytes(apr_pool_t* p, char** uncompressedData, const void* bytes, size_t length) | |
| { | |
| z_stream strm; | |
| int ret; | |
| unsigned char out[128 * 1024]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int nthreads = Math.max(1, Runtime.getRuntime().availableProcessors() / 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <updateRequestProcessorChain name="trackingchain" default="true"> | |
| <processor class="solr.LogUpdateProcessorFactory" /> | |
| <processor class="solr.DistributedUpdateProcessorFactory" /> | |
| <processor class="com.vivareal.solr.plugin.processor.TrackingUpdateRequestProcessorFactory" /> | |
| <processor class="solr.RunUpdateProcessorFactory" /> | |
| </updateRequestProcessorChain> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TrackingUpdateRequestProcessor extends UpdateRequestProcessor { | |
| private final SchemaField sf; | |
| public static ConcurrentHashMap<BytesRef, Long> changes = new ConcurrentHashMap<>(); | |
| public TrackingUpdateRequestProcessor(SolrQueryRequest req, UpdateRequestProcessor next) { | |
| super(next); | |
| sf = req.getCore().getLatestSchema().getUniqueKeyField(); | |
| } | |
| @Override |
OlderNewer