mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel
This commit is contained in:
commit
e37220ea06
10
CHANGELOG
10
CHANGELOG
|
@ -1,6 +1,16 @@
|
|||
v2.3.0 (XXXX-XX-XX)
|
||||
-------------------
|
||||
|
||||
* added command-line option `--javascript.v8-contexts` to control the number of
|
||||
V8 contexts created in arangod.
|
||||
|
||||
Previously, the number of V8 contexts was equal to the number of server threads
|
||||
(as specified by option `--server.threads`). However, it may be sensible to
|
||||
create different amounts of threads and V8 contexts. If the option is not
|
||||
specified, the number of V8 contexts created will be equal to the number of
|
||||
server threads. Thus no change in configuration is required to keep the old
|
||||
behavior.
|
||||
|
||||
* removed bitarray indexes
|
||||
|
||||
* removed internal "_admin/modules/flush" in order to fix requireApp
|
||||
|
|
|
@ -8,7 +8,7 @@ You can use this to define your own extra variables and functions that you need
|
|||
For example, you could put the following into the *.arangosh.rc* file in your home
|
||||
directory:
|
||||
|
||||
```
|
||||
```js
|
||||
// var keyword omitted intentionally,
|
||||
// otherwise "timed" would not survive the scope of this script
|
||||
timed = function (cb) {
|
||||
|
@ -23,7 +23,7 @@ This will make a function named *timed* available in _arangosh_ in the global sc
|
|||
|
||||
You can now start _arangosh_ and invoke the function like this:
|
||||
|
||||
```
|
||||
```js
|
||||
timed(function () {
|
||||
for (var i = 0; i < 1000; ++i) {
|
||||
db.test.save({ value: i });
|
||||
|
|
|
@ -36,6 +36,10 @@
|
|||
@startDocuBlock serverAllowMethod
|
||||
|
||||
|
||||
!SUBSECTION Server threads
|
||||
@startDocuBlock serverThreads
|
||||
|
||||
|
||||
!SUBSECTION Keyfile
|
||||
@startDocuBlock serverKeyfile
|
||||
|
||||
|
@ -64,12 +68,12 @@
|
|||
@startDocuBlock serverBacklog
|
||||
|
||||
|
||||
!SUBSECTION Disable statics
|
||||
!SUBSECTION Disable statistics
|
||||
|
||||
`--disable-statistics value`
|
||||
|
||||
If this option is *value* is *true*, then ArangoDB's statistics gathering
|
||||
is turned off. Statistics gathering causes constant CPU activity so using this
|
||||
is turned off. Statistics gathering causes regular CPU activity so using this
|
||||
option to turn it off might relieve heavy-loaded instances.
|
||||
Note: this option is only available when ArangoDB has not been compiled with
|
||||
the option *--disable-figures*.
|
||||
|
@ -90,6 +94,10 @@ the option *--disable-figures*.
|
|||
@startDocuBlock databaseForceSyncProperties
|
||||
|
||||
|
||||
!SUBSECTION V8 Contexts
|
||||
@startDocuBlock v8Contexts
|
||||
|
||||
|
||||
!SUBSECTION Frequency
|
||||
@startDocuBlock jsGcFrequency
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
!CHAPTER Command-Line Options for Communication
|
||||
|
||||
!SUBSECTION Scheduler threads
|
||||
<!-- lib/Scheduler/ApplicationScheduler.h -->
|
||||
@startDocuBlock schedulerThreads
|
||||
|
||||
|
||||
!SUBSECTION Scheduler maximal queue size
|
||||
<!-- arangod/RestServer/ArangoServer.h -->
|
||||
@startDocuBlock serverAuthenticationDisable
|
||||
@startDocuBlock schedulerMaximalQueueSize
|
||||
|
||||
|
||||
!SUBSECTION Scheduler backend
|
||||
<!-- lib/Scheduler/ApplicationScheduler.h -->
|
||||
@startDocuBlock schedulerBackend
|
||||
|
||||
|
||||
!SUBSECTION Io backends
|
||||
`--show-io-backends`
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
!SUBSECTION In Case Of Disaster
|
||||
|
||||
The following command starts a emergency console.
|
||||
The following command starts an emergency console.
|
||||
|
||||
**Note**: Never start the emergency console for a database which also has a
|
||||
server attached to it. In general the ArangoDB shell is what you want.
|
||||
|
@ -14,18 +14,16 @@ ArangoDB shell [V8 version 3.9.4, DB version 1.x.y]
|
|||
arango> 1 + 2;
|
||||
3
|
||||
|
||||
arango> db.geo.count();
|
||||
arango> var db = require("org/arangodb").db; db.geo.count();
|
||||
703
|
||||
|
||||
```
|
||||
|
||||
The emergency console disables the HTTP interface of the server and
|
||||
opens a JavaScript console on standard output instead. This allows you
|
||||
to debug and examine collections and documents without interference
|
||||
from the outside. In most respects the emergency console behaves like
|
||||
the normal ArangoDB shell - but with exclusive access and no
|
||||
client/server communication.
|
||||
The emergency console provides a JavaScript console directly running in the
|
||||
arangod server process. This allows to debug and examine collections and
|
||||
documents as with the normal ArangoDB shell, but without client/server
|
||||
communication.
|
||||
|
||||
However, it is very likely that you never need the emergency console
|
||||
However, it is very likely that you will never need the emergency console
|
||||
unless you are an ArangoDB developer.
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
!SUBSECTION Command-Line Options for Random Numbers
|
||||
|
||||
<!-- lib/ApplicationServer/ApplicationServer.h -->
|
||||
@startDocuBlock randomGenerator
|
|
@ -138,14 +138,13 @@
|
|||
* [Authentication](Sharding/Authentication.md)
|
||||
* [Firewall setup](Sharding/FirewallSetup.md)
|
||||
<!-- 20 -->
|
||||
* [Configure ArangoDB](ConfigureArango/README.md)
|
||||
* [Server Configuration](ConfigureArango/README.md)
|
||||
* [Arangod options](ConfigureArango/Arangod.md)
|
||||
* [Write-ahead log options](ConfigureArango/Wal.md)
|
||||
* [Endpoints options](ConfigureArango/Endpoint.md)
|
||||
* [Cluster options](ConfigureArango/Cluster.md)
|
||||
* [Logging options](ConfigureArango/Logging.md)
|
||||
* [Communication options](ConfigureArango/Communication.md)
|
||||
* [Random numbers](ConfigureArango/RandomNumbers.md)
|
||||
* [Authentication](ConfigureArango/Authentication.md)
|
||||
* [Emergency Console](ConfigureArango/EmergencyConsole.md)
|
||||
<!-- 21 -->
|
||||
|
|
24
README.md
24
README.md
|
@ -40,22 +40,28 @@ For Mac OSX users: execute
|
|||
For Windows and Linux users: use the installer script or distribution package
|
||||
from our [download page](http://www.arangodb.com/download).
|
||||
|
||||
If the package manager has not already started the ArangoDB server, use
|
||||
If the package manager has not already started the ArangoDB server, use the
|
||||
following command to start it.
|
||||
|
||||
unix> /path/to/sbin/arangod
|
||||
2012-03-30T12:54:19Z [11794] INFO ArangoDB (version 2.x.y) is ready for business
|
||||
2012-03-30T12:54:19Z [11794] INFO Have Fun!
|
||||
|
||||
`/path/to/sbin` is OS dependent. It will normally by either `/usr/sbin` or `/user/local/sbin`. Point your browser to
|
||||
`/path/to/sbin` is OS dependent. It will normally be either `/usr/sbin` or `/user/local/sbin`.
|
||||
|
||||
To access ArangoDB in your browser, open the following URL
|
||||
|
||||
http://localhost:8529/
|
||||
|
||||
and select `Tools / JS Shell`. You can now use the Arango shell from within your browser. Alternative, it is available as command-line tool _arangosh_.
|
||||
and select `Tools / JS Shell`. You can now use the Arango shell from within your browser.
|
||||
|
||||
Alternatively, a scriptable shell is available as a command-line tool _arangosh_.
|
||||
|
||||
arangosh> db._create("hello");
|
||||
arangosh> db.hello.save({ world: "earth" });
|
||||
|
||||
Congratulations! You have created your first collection called `hello` and your first document. To verify your achievements, type:
|
||||
Congratulations! You have created your first collection named `hello` and your first document.
|
||||
To verify your achievements, type:
|
||||
|
||||
arangosh> db.hello.toArray();
|
||||
|
||||
|
@ -64,15 +70,15 @@ More Information
|
|||
----------------
|
||||
|
||||
Please check the
|
||||
[Installation Manual](http://www.arangodb.com/manuals/current/InstallManual.html)
|
||||
[Installation Manual](https://www.arangodb.com/Installing/README.html)
|
||||
for installation and compilation instructions.
|
||||
|
||||
The
|
||||
[User Manual](http://www.arangodb.com/manuals/current/UserManual.html)
|
||||
[User Manual](https://www.arangodb.com/FirstSteps/README.html)
|
||||
has an introductory chapter showing the basic operations of ArangoDB.
|
||||
|
||||
Or you can use the
|
||||
[online tutorial](http://www.arangodb.com/try)
|
||||
[online tutorial](https://www.arangodb.com/tryitout)
|
||||
to play with ArangoDB without installing it locally.
|
||||
|
||||
|
||||
|
@ -86,7 +92,7 @@ you report them:
|
|||
|
||||
You can use the Google group for improvements, feature requests, comments
|
||||
|
||||
[http://www.arangodb.com/community](http://www.arangodb.com/community)
|
||||
[http://www.arangodb.com/community](https://www.arangodb.com/community)
|
||||
|
||||
|
||||
Citing ArangoDB
|
||||
|
@ -96,7 +102,7 @@ Please kindly cite ArangoDB in your publications if it helps your research:
|
|||
```bibtex
|
||||
@misc{ArangoDB2014,
|
||||
Author = {ArangoDB},
|
||||
Title = { {ArangoDB 2.2}: An Open Source multi-purpose database supporting flexible data models for documents, graphs, and key-values.},
|
||||
Title = { {ArangoDB 2.3}: An Open source, multi-purpose database supporting flexible data models for documents, graphs, and key-values.},
|
||||
Year = {2014},
|
||||
Howpublished = {\url{http://arangodb.com/}
|
||||
}
|
||||
|
|
|
@ -1018,20 +1018,25 @@ AstNode* Ast::clone (AstNode const* node) {
|
|||
}
|
||||
else if (type == NODE_TYPE_VALUE) {
|
||||
switch (node->value.type) {
|
||||
case VALUE_TYPE_NULL:
|
||||
copy->value.type = VALUE_TYPE_NULL;
|
||||
break;
|
||||
case VALUE_TYPE_BOOL:
|
||||
copy->value.type = VALUE_TYPE_BOOL;
|
||||
copy->setBoolValue(node->getBoolValue());
|
||||
break;
|
||||
case VALUE_TYPE_INT:
|
||||
copy->value.type = VALUE_TYPE_INT;
|
||||
copy->setIntValue(node->getIntValue());
|
||||
break;
|
||||
case VALUE_TYPE_DOUBLE:
|
||||
copy->value.type = VALUE_TYPE_DOUBLE;
|
||||
copy->setDoubleValue(node->getDoubleValue());
|
||||
break;
|
||||
case VALUE_TYPE_STRING:
|
||||
copy->value.type = VALUE_TYPE_STRING;
|
||||
copy->setStringValue(node->getStringValue());
|
||||
break;
|
||||
default: {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -281,6 +281,7 @@ ArangoServer::ArangoServer (int argc, char** argv)
|
|||
_disableAuthenticationUnixSockets(false),
|
||||
_dispatcherThreads(8),
|
||||
_dispatcherQueueSize(8192),
|
||||
_v8Contexts(8),
|
||||
_databasePath(),
|
||||
_defaultMaximalSize(TRI_JOURNAL_DEFAULT_MAXIMAL_SIZE),
|
||||
_defaultWaitForSync(false),
|
||||
|
@ -560,6 +561,7 @@ void ArangoServer::buildApplicationServer () {
|
|||
|
||||
additional["THREAD Options:help-admin"]
|
||||
("server.threads", &_dispatcherThreads, "number of threads for basic operations")
|
||||
("javascript.v8-contexts", &_v8Contexts, "number of V8 contexts that are created for executing JavaScript actions")
|
||||
;
|
||||
|
||||
additional["Server Options:help-extended"]
|
||||
|
@ -795,25 +797,35 @@ int ArangoServer::startupServer () {
|
|||
|
||||
TRI_ASSERT(vocbase != nullptr);
|
||||
|
||||
|
||||
// initialise V8
|
||||
size_t concurrency = _dispatcherThreads;
|
||||
if (! _applicationServer->programOptions().has("javascript.v8-contexts")) {
|
||||
// the option was added recently so it's not always set
|
||||
// the behavior in older ArangoDB was to create one V8 context per dispatcher thread
|
||||
_v8Contexts = _dispatcherThreads;
|
||||
}
|
||||
|
||||
if (_v8Contexts < 1) {
|
||||
_v8Contexts = 1;
|
||||
}
|
||||
|
||||
if (mode == OperationMode::MODE_CONSOLE) {
|
||||
// one V8 instance is taken by the console
|
||||
if (startServer) {
|
||||
++concurrency;
|
||||
++_v8Contexts;
|
||||
}
|
||||
}
|
||||
else if (mode == OperationMode::MODE_UNITTESTS || mode == OperationMode::MODE_SCRIPT) {
|
||||
if (concurrency == 1) {
|
||||
// at least two to allow the test-runner and the scheduler to use a V8
|
||||
concurrency = 2;
|
||||
if (_v8Contexts == 1) {
|
||||
// at least two to allow both the test-runner and the scheduler to use a V8 instance
|
||||
_v8Contexts = 2;
|
||||
}
|
||||
}
|
||||
|
||||
_applicationV8->setVocbase(vocbase);
|
||||
_applicationV8->setConcurrency(concurrency);
|
||||
_applicationV8->setConcurrency(_v8Contexts);
|
||||
_applicationV8->defineDouble("DISPATCHER_THREADS", _dispatcherThreads);
|
||||
_applicationV8->defineDouble("V8_CONTEXTS", _v8Contexts);
|
||||
|
||||
// .............................................................................
|
||||
// prepare everything
|
||||
|
|
|
@ -317,12 +317,12 @@ namespace triagens {
|
|||
bool _disableAuthenticationUnixSockets;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief number of dispatcher threads for non-database worker
|
||||
/// @brief number of dispatcher threads
|
||||
/// @startDocuBlock serverThreads
|
||||
/// `--server.threads number`
|
||||
///
|
||||
/// Specifies the *number* of threads that are spawned to handle action
|
||||
/// requests using Rest, JavaScript, or Ruby.
|
||||
/// Specifies the *number* of threads that are spawned to handle HTTP REST
|
||||
/// requests.
|
||||
/// @endDocuBlock
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -330,7 +330,7 @@ namespace triagens {
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief maximum size of the dispatcher queue for asynchronous requests
|
||||
/// @startDocuBlock serverAuthenticationDisable
|
||||
/// @startDocuBlock schedulerMaximalQueueSize
|
||||
/// `--scheduler.maximal-queue-size size`
|
||||
///
|
||||
/// Specifies the maximum *size* of the dispatcher queue for asynchronous
|
||||
|
@ -343,6 +343,21 @@ namespace triagens {
|
|||
|
||||
int _dispatcherQueueSize;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief number of V8 contexts for executing JavaScript actions
|
||||
/// @startDocuBlock v8Contexts
|
||||
/// `--server.v8-contexts number`
|
||||
///
|
||||
/// Specifies the *number* of V8 contexts that are created for executing
|
||||
/// JavaScript code. More contexts allow execute more JavaScript actions in
|
||||
/// parallel, provided that there are also enough threads available. Please
|
||||
/// note that each V8 context will use a substantial amount of memory and
|
||||
/// requires periodic CPU processing time for garbage collection.
|
||||
/// @endDocuBlock
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int _v8Contexts;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief path to the database
|
||||
/// @startDocuBlock DatabaseDirectory
|
||||
|
|
Loading…
Reference in New Issue