<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>A note regarding the Sqlite/MySQL (and possibly MSSQL, if it's based on the same code) RegionStore implementation;<BR>
 <BR>
the region datastore in those adapters is borked, as it depends on a pre-initialized and re-used set of commands, all connected to one db connection, which means that we need to lock the database while updating (else the commands risk getting effed up), and that we never can use more than one connection. This means all db requests are thread-and-db synch end to end, which leads to real bad response times.<BR><BR>That needs to be remedied asap. I have a tablemapper/rowmapper pattern on my hard disk that I could commit for discussion if the crew see fit?<BR>
 <BR>
/Stefan<BR><BR><BR>
<BLOCKQUOTE>
<HR id=EC_stopSpelling>
Date: Wed, 12 Dec 2007 21:52:01 -0500<BR>From: teravus@gmail.com<BR>To: opensim-dev@lists.berlios.de<BR>Subject: [Opensim-dev] 20,256 prim test<BR><BR>
<DIV>Greetings everyone</DIV>
<DIV> </DIV>
<DIV>I was having fun tiling the ground and above with .25 meter cubes and ended up with this;</DIV>
<DIV><SPAN class=EC_ppt id=EC__user_opensim-dev@lists.berlios.de><A href="http://opensimulator.org/images/d/d0/My20000Test_001.jpg" target=_blank>http://opensimulator.org/images/d/d0/My20000Test_001.jpg</A></SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>This test was conducted on a 100MB ethernet network.</SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>The instance is running 3 regions, two with no prim in it.</SPAN></DIV>
<DIV><SPAN class=EC_ppt>The sim is running ODE with a single agent.</SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>
<DIV><SPAN class=EC_ppt>The client is running on a different machine then the sim.</SPAN></DIV>
<DIV><SPAN class=EC_ppt>This was using the mySQL DB interface in Grid Mode</SPAN></DIV></SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>at 16,750 prim, the instance of OpenSim was using up 45% of a dual core 3Ghz processor(one core)</SPAN></DIV>
<DIV><SPAN class=EC_ppt>at 20,256 prim, the instance of OpenSim was using up 22% of a dual core 3Ghz processor(both cores)</SPAN></DIV>
<DIV><SPAN class=EC_ppt>In both cases the memory usage was around 145MB of RAM</SPAN></DIV>
<DIV><SPAN class=EC_ppt>using 58 Threads</SPAN></DIV>
<DIV><SPAN class=EC_ppt>758 handles</SPAN></DIV>
<DIV><SPAN class=EC_ppt>avg 1600 context switches</SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>.NET Perf Info</SPAN></DIV>
<DIV><SPAN class=EC_ppt>11,750,740 = # Marshaling with unmanaged code(ODE)</SPAN></DIV>
<DIV><SPAN class=EC_ppt>2,839 = # GC handles</SPAN></DIV>
<DIV><SPAN class=EC_ppt>0.10 - 0.36  = % Time in GC</SPAN></DIV>
<DIV><SPAN class=EC_ppt>4,840 = Classes loaded</SPAN></DIV>
<DIV><SPAN class=EC_ppt>69 = Total Assemblies</SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>.NET </SPAN><SPAN class=EC_ppt>Locking and Threads</SPAN></DIV>
<DIV><SPAN class=EC_ppt>2 = locking contentions /sec</SPAN></DIV>
<DIV><SPAN class=EC_ppt>75,505+ and increasing = Queue Length peak</SPAN></DIV>
<DIV><SPAN class=EC_ppt>58 = Logical threads</SPAN></DIV>
<DIV><SPAN class=EC_ppt>4,294,967,033 = physical Threads</SPAN></DIV>
<DIV><SPAN class=EC_ppt>322 = current recognized threads</SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>A couple of notes.</SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>It's really difficult to get to 20,000 prim.    The reason is DataStore Database backup takes an hour (based on prim duplications).</SPAN></DIV>
<DIV><SPAN class=EC_ppt>At least with mySQL, this can be done asynchronously, I suggest we do that, otherwise you can DOS a sim simply by copying prim.</SPAN></DIV>
<DIV><SPAN class=EC_ppt>IMHO, this is the *WORST* performance bog that we've got.  Even worse then the packet object create and discard.</SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>When logging into the sim, it takes about 3 minutes on a 100MB network to get all 20,256 prim at 600Kb/sec.  During that time, you can't really move because everything is being pushed through the Task throttle (this is by design).   Before this becomes general practice, we'll need to make sure we limit the amount of prim that go out at a time to a client.   </SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>One 3Ghz core could handle approx 18,000 prim before stalling in between frames.</SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>Once again, </SPAN></DIV>
<DIV><SPAN class=EC_ppt>Have a look at the picture.  It has the sim stats visible</SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>Best Regards</SPAN></DIV>
<DIV><SPAN class=EC_ppt></SPAN> </DIV>
<DIV><SPAN class=EC_ppt>Teravus Ousley</SPAN></DIV></BLOCKQUOTE></body>
</html>