This file contains 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
https://github.com/cloudwu/skynet/pull/208/files | |
diff --git a/skynet-src/skynet_mq.c b/skynet-src/skynet_mq.c | |
index 8cc8f9d..51f47ef 100644 | |
--- a/skynet-src/skynet_mq.c | |
+++ b/skynet-src/skynet_mq.c | |
@@ -32,12 +32,9 @@ struct message_queue { | |
}; | |
struct global_queue { |
This file contains 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
%% Description: A simple FSM for a code lock with three states | |
%% based on an example from the OTP system documentation | |
-module(code_lock_fsm). | |
-behaviour(gen_fsm). | |
%% public API functions | |
-export([start_link/1, stop/0, button/1, reset/0, get_state/0]). | |
%% state names | |
-export([locked/2, locked/3, open/2, open/3]). |
This file contains 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
%% Copyright (c) 2011 Basho Technologies, Inc. All Rights Reserved. | |
%% | |
%% This file is provided to you under the Apache License, | |
%% Version 2.0 (the "License"); you may not use this file | |
%% except in compliance with the License. You may obtain | |
%% a copy of the License at | |
%% | |
%% http://www.apache.org/licenses/LICENSE-2.0 | |
%% | |
%% Unless required by applicable law or agreed to in writing, |
This file contains 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
# set up flags for Numpy C extentions compiling | |
export CFLAGS="-arch i386 -arch x86_64" | |
export FFLAGS="-m32 -m64" | |
export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64" | |
export CC=gcc-4.2 | |
export CXX="g++ -arch i386 -arch x86_64" | |
pip install numpy | |
# success! |
This file contains 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
#!/bin/sh | |
# | |
# Usage: ./redis-delkeys.sh [-h host] [-p port] [-n db] pattern | |
# | |
# Matches keys with the KEYS command matching pattern | |
# and deletes them from the specified Redis DB. | |
set -e | |
HOST="localhost" |
This file contains 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
[erlang:garbage_collect(Pid) || Pid <- processes()]. |
This file contains 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
If you want, I can try and help with pointers as to how to improve the indexing speed you get. Its quite easy to really increase it by using some simple guidelines, for example: | |
- Use create in the index API (assuming you can). | |
- Relax the real time aspect from 1 second to something a bit higher (index.engine.robin.refresh_interval). | |
- Increase the indexing buffer size (indices.memory.index_buffer_size), it defaults to the value 10% which is 10% of the heap. | |
- Increase the number of dirty operations that trigger automatic flush (so the translog won't get really big, even though its FS based) by setting index.translog.flush_threshold (defaults to 5000). | |
- Increase the memory allocated to elasticsearch node. By default its 1g. | |
- Start with a lower replica count (even 0), and then once the bulk loading is done, increate it to the value you want it to be using the update_settings API. This will improve things as possibly less shards will be allocated to each machine. | |
- Increase the number of machines you have so |
This file contains 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
curl -XDELETE http://localhost:9200/ac-test | |
curl -XPUT http://localhost:9200/ac-test | |
curl -XPUT http://localhost:9200/ac-test/people/1 -d ' | |
{ | |
"firstNames" : "James Earl", | |
"lastName" : "Jones", | |
"location" : "Hollywood, CA" | |
}' | |
curl -XPUT http://localhost:9200/ac-test/people/2 -d ' |
This file contains 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
byte_size(V). | |
599833 | |
binary:replace(V, <<0>>, <<>>, [global]). | |
binary:part(V,{10, 1000}). | |
This file contains 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
def bits(n): | |
while n: | |
b = n & (~n+1) | |
yield b | |
n ^= b | |
>>> for b in bits(109): | |
print(b) |