xdmp-cancelled when trying to generate millions of random xml documents

Hi Sudhir,



I guess you are reaching a timeout. You’d best spawn sub processes to
create portions of the total number of docs you want to generate, for
instance in batches of 100 (in case they are relatively large) or 500 (in
case they are quite small). This also allows utilizing resources more
optimally, so might be quicker.



Do keep an eye on the task server queue though, spawning 100.000 sub tasks
could max out the queue size. There are ways around this, but perhaps it is
easiest to just run the whole process a few number of times. You could use
xdmp:random to generate id’s for docs, saving you the hassle of keeping
track which number you did or didn’t reach..



Cheers,

Geert





*Van:* [email protected] [mailto:
[email protected]] *Namens *[email protected]
*Verzonden:* donderdag 20 juni 2013 9:50
*Aan:* [email protected]
*Onderwerp:* [MarkLogic Dev General] xdmp-cancelled when trying to generate
millions of random xml documents





Hi All,

I try something like

for $numDays in (1 to 1000000)
let $uriName := fn:concat("/abc/xyz",$numDays,".xml")
Return
xdmp:document-insert($uriName,
<abc>xyz</abc>)

In the actual document I generate some random values and actual xml is much
larger.

So if I try it for 1 to 100000 it works fine..But if I try 1 million or
more in the loop, I get* XDMP-CANCELLED* error.
Noone touches the db all this while.
I try catching the exception but looks like I can't catch* **
'XDMP-CANCELLED'* exception.

Now please suggest that if I need to create millions of documents how
should I make it work.

Thanks,
Sudhir
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to