[basex-talk] Performance and heavy load

2015-07-27 Thread Martín Ferrari
Hi guys,I'm quite new to BaseX. I've read a bit already, but perhaps you 
can help so I can investigate further. We are having a performance problem with 
our BaseX server. We're running it on a VM, and hitting it from around 5 web 
servers.
Under no stress, I get this timing from the log for a 1191 bytes file.
00:01:23.526ww.aa.yy.xx:56312 admin   REQUEST [PUT] 
http://basex.xx:8984/rest/PaymentLogs_1/WRP.BR-4273791-1_PaymentGateway_Response_20150728000116.xml00:01:24.967
ww.aa.yy.xx:56312 admin   201 1 resource(s) replaced in 1401.17 ms.   
1441.24 ms
A call to /rest takes about 4-5 ms (it's called around once each 2 seconds, 
though it's not needed):
00:01:23.520ww.aa.yy.zz:56312 admin   REQUEST [GET] 
http://basex.:8984/rest00:01:23.524ww.aa.yy.xx:56312 admin   200
 4.67 ms

 Is the 1400 ms time normal for storing one xml file less than 2kb (storing 
a 10kb file took 1200 ms, so I'm not sure size mattered that much)?
 And also, when the load starts to get heavier, from 7 to 12 files per 
second, BaseX server quickly starts to get slower, then taking minutes to 
respond, until finally it starts giving errors about the database being 
currently opened by another process, and too many open files. Many connections 
remain in the CLOSE_WAIT state, and the server is no longer usable.
Is it reasonable to expect to [PUT] more than 10 files per second, some of them 
taking more than 10kb? We're using it for logging, so that's a lot of xml 
files. If it's reasonable to use it that way, I'll dig more into optimizing it. 
Is anyone using it in a similar way? 
Thanks, Martín.   

[basex-talk] Error [FODC0002] when XSL returns sequence

2015-07-27 Thread Maximilian Gärber
Hi,

calling the test-xsl function does not work (might be a bug). I think
returning a document fragment from xsl is not forbidden (at least
exist-db permits it).

The transform itself uses Saxon HE but this seems not related.

-- start xqm --

xquery version 3.0;

module namespace _= http://foo.org/test;;
import module namespace xslt = http://basex.org/modules/xslt;;

declare variable $_:DATA := foo
bar1/bar1
bar2/bar2
  /foo;

declare variable $_:XSL := xsl:stylesheet version=2.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
  xsl:output method=xhtml/
   xsl:template match=/*/*
 divsome div/div
   /xsl:template
  /xsl:stylesheet;

declare
  %rest:GET
  %rest:path(test-xsl)
function _:test-xsl(){

   let $out := xslt:transform($_:DATA, $_:XSL)
   return $out

};

--- end xqm --


Message:

Stopped at test-xsl.xqm, 26/31:
[FODC0002]  (Line 2): Markup im Dokument nach dem Root-Element muss
ordnungsgemäß formatiert sein.


Regards, Max


[basex-talk] RESTXQ: wrong doctype with xhtml method

2015-07-27 Thread Maximilian Gärber
Hi,

when using 'xhtml' output method, the doctype always matches the name
of the root element (instead of 'html').

Does not happen with 'html' output method.

-- start xqm --

declare
  %rest:GET
  %rest:path(test-frag)
  %output:method(xhtml)
  %output:html-version(5.0)
function _:test-frag(){

  form

  /form

};

-- end xqm --

Result:

!DOCTYPE form
form/form

Regards,

Max