something very wrong with rest api in orientdb 1.6.3 (build 0)

99 views
Skip to first unread message

Jonathan Rosen

unread,
Jan 3, 2014, 4:26:11 PM1/3/14
to orient-...@googlegroups.com
When I issue a command to the rest api in the latest version of orientdb, it takes an inordinately long time for anything to happen.

For example, if I issue this post request:
url: http://admin:admin@localhost:2480/command/mydb/sql/
body: insert%20into%20stuff(name)%20VALUES%20(%27testing%27)

That query takes 30.027 seconds to execute. Likewise similar insertion operations to the database. My curl requests from php are timing out due to how long these types of requests are taking.

What is going on here? I observed this first on my Ubuntu production server, and then installed 1.6.3 locally on my Mac to verify. Both lead to the same result...

I installed via ant from Github in both cases. Am I missing something here in terms of server configuration?

Luca Garulli

unread,
Jan 4, 2014, 1:30:01 AM1/4/14
to orient-database
Hi,
that is a simple insert, so the execution time is supposed to be under half second even with the slowest computer. How can I reproduce it?

Lvc@



--
 
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jonathan Rosen

unread,
Jan 4, 2014, 12:54:31 PM1/4/14
to orient-...@googlegroups.com
I installed from Github source using ant:
> git clone g...@github.com:orientechnologies/orientdb.git
> cd orientdb
> ant clean install

Then I started up database server (/bin/server.sh). I created a new database in the console (to mitigate risk that problem was from import of old db).

Then if you open any curl client, and issue the command I pasted below, the database takes a very long time and eventually it will succeed.

The same query executes in normal time from the console. It appears to be REST that is affected.

Luca Garulli

unread,
Jan 4, 2014, 1:18:15 PM1/4/14
to orient-database
Hi Jonathan,
you're right! curl uses the header "Accept: */*" and OrientDB can't manage the response in the right way. I've just fixed this on "develop" branch. Or you can add this when you use curl:

--header "Accept: application/json"

Example:

curl -u admin:admin --header "Accept: application/json" --data "insert%20into%20stuff(name)%20VALUES%20(%27testing%27)" http://localhost:2480/command/GratefulDeadConcerts/sql/


Lvc@

Jonathan Rosen

unread,
Jan 4, 2014, 1:51:48 PM1/4/14
to orient-...@googlegroups.com
Great, thanks for you help! Now I can upgrade to the latest version. I'll probably just modify the orientdb-odm curl client until this gets rolled into the next release.


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/HknWdyc4W7Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Jonathan Rosen

unread,
Jan 4, 2014, 3:18:14 PM1/4/14
to orient-...@googlegroups.com
For anyone else with this problem, paste the following line into /src/Doctrine/OrientDB/Binding/HTTPBinding.php below line 43 (in the constructor). That will fix the problem when using the php orientdb-odm library.

        $this->adapter->getClient()->setHeader('Accept', 'application/json');
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/HknWdyc4W7Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-database+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages