Commit Graph

21343 Commits (b40483dd27319b9b8ea00808d38da0652dbd98a2)

Author SHA1 Message Date
Justin Clark-Casey (justincc) b40483dd27 For processing outbound http requests in the XMLRPCModule, start the thread through Watchdog for monitoring and stat purposes. 2014-09-04 18:53:59 +01:00
Justin Clark-Casey (justincc) cbf4106987 Start long-lived thread in IRCConnector via watchdog rather than indepedently, so that it can be seen in "show threads" and stats 2014-09-04 18:53:55 +01:00
Justin Clark-Casey (justincc) badeefdf99 Don't need to check separate physics status in bulletsim update since that method is only run for an indepndent thread anyway.
Also remove bulletsim monitored thread from watchdog on shutdown.
2014-09-04 18:53:45 +01:00
Justin Clark-Casey (justincc) 771011542a Make bulletsim thread alarm if no update for 5 seconds.
The cost is minimal (also done for scene loop) at the benefit of telling us if this thread simply stops for some reason.
2014-09-04 18:53:41 +01:00
Justin Clark-Casey (justincc) 2f0dfb055c minor: fix indenting from previous commit b08ab1e 2014-09-04 18:53:38 +01:00
Justin Clark-Casey (justincc) 78734dd723 If BulletSim is running on its own threads, start this thread via the thread watchdog.
This allows us to see the presence of the permanent thread via the "show threads" console comand.
Also adds the region name to the thread name.
2014-09-04 18:53:32 +01:00
Kevin Cozens 3f2aaa910a Don't show the ScrLPS data twice in the WebStats based statistics page. 2014-09-04 18:53:22 +01:00
Justin Clark-Casey (justincc) 793dc74cf4 Add [EntityTransfer] AllowAvatarCrossing setting to determine whether avatars are allowed to cross regions at all.
Defaults to true.  For test purposes.
2014-09-04 18:53:12 +01:00
Justin Clark-Casey (justincc) 3f8a0a95da Ignore whitespace when reading serialized XML objects.
This was previously effectively being done by XmlDocument in the multiple passes through the XML.
This change tells XmlReader to ignore whitespace.  This also means changing arguments to use XmlReader instead of XmlTextReader (a descendent of XmlReader) directly.
XmlReader.Create() has been the recommend way to create XML readers since .NET 2.0 as per MS SDK and is the only way to specific ignore whitespace settings.
2014-09-04 18:52:47 +01:00
Justin Clark-Casey (justincc) 38df5f1e9b Fix recent regression test TestDeserializeXmlObjectWithOtherParts() which was not meant to indent the input xml 2014-09-04 18:52:43 +01:00
Justin Clark-Casey (justincc) 8acb863060 Add regression test for deserializing xml objects with more than one non-root part. 2014-09-04 18:52:37 +01:00
Justin Clark-Casey (justincc) 27299438d0 minor: Eliminate more unnecessary code copying individual parameters for Vector3 copying in Scene - this is not necessary as Vector3 is a value type 2014-09-04 18:52:34 +01:00
Justin Clark-Casey (justincc) 5eb6b14854 On code section that rezzes single objects and attachments, reduce CPU use by reading asset XML a single time with a stream reader rather than multiple times.
Reading large XML documents (e.g. complex attachments) is CPU expensive - this must be done as few times as possible (preferably just once).
Reading these documents into XmlDocument is also more resource intensive than using XmlTextReader, as per Microsoft's own publication "Improve .NET Application Performance and Scalability"
Optimization of other cases will follow if this change is successful.
2014-09-04 18:52:29 +01:00
Justin Clark-Casey (justincc) 5614b28886 Remove race conditions from where SP.AbsolutePosition could change between the various property checks. 2014-09-04 18:52:20 +01:00
Justin Clark-Casey (justincc) a068c1dd9d Remove database connection locking in MySQLXAssetData. This is unnecessary as connections aren't shared and transactions are already in place where necessary. 2014-09-04 18:51:12 +01:00
Justin Clark-Casey (justincc) 3d49be21bc Remove query locking in MySQLUserProfileData. This is not necessary as the connection is not shared. 2014-09-04 18:51:06 +01:00
Justin Clark-Casey (justincc) 3438985b0d Remove some use of database connection locking from MySQLSimulationData - this has not been necessary for some time as database connections are not shared.
However, many locks remain since they may effectively be providing transactionality in some operations (e.g. prim updates across multiple tables).
These are candidates for being replaced with proper database transactions, since this would not block unrelated operations (e.g. land save and object save)
or unrelated operations on the same tables (e.g. storage of one linkset whilst another is being removed).
In practice, any performance deg due to contention is probably rare and short lived as the major prim operations are performed in memory and only persisted some time afterwards.
2014-09-04 18:51:01 +01:00
Justin Clark-Casey (justincc) 8dd6830efb Remove lock in MySQLFramework. This is not necessary as the connection is not shared. 2014-09-04 18:50:57 +01:00
Justin Clark-Casey (justincc) 2e1e076629 Removing locking on requests in MySQLAssetData.
These locks are not necessary since the connection is taken from the underlying mysql pool and not shared.
Such locking is already not done by some other parts of OpenSim.Data.MySQL.
Pointed out by arribasim-dev
2014-09-04 18:50:53 +01:00
Justin Clark-Casey (justincc) 30e04ee79c Extend drop command to "debug lludp drop <in|out>..." to allow drop of inbound packets.
For test/debug purposes.
2014-09-04 18:50:49 +01:00
Justin Clark-Casey (justincc) e0cb3ef959 Add "debug lludp drop out <add|remove> <packet-name>" console command for debug/test purposes.
This drops all outbound packets that match a given packet name.
Can currently only be applied to all connections in a scene.
2014-09-04 18:50:44 +01:00
Justin Clark-Casey (justincc) 4f12d5a3f1 minor:Give console feedback when we sit or stand pCampbot bots.
Also only write console lines for actually connected bots.
2014-09-04 18:50:39 +01:00
Justin Clark-Casey (justincc) c83eb4eb0a Add clientstack.<scene>.OQRERequestsWaiting stat
Only present if OQRE is enabled
2014-09-04 18:50:34 +01:00
Justin Clark-Casey (justincc) 34a5c3be24 Add experimental OutgoingQueueRefillEngine to handle queue refill processing on a controlled number of threads rather than the threadpool.
Disabled by default.  Currently can only be enabled with console "debug lludp oqre start" command, though this can be started and stopped whilst simulator is running.
When a connection requires packet queue refill processing (used to populate queues with entity updates, entity prop updates and image queue updates), this is done via Threadpool requests.
However, with a very high number of connections (e.g. 100 root + 300 child) a very large number of simultaneous requests may be causing performance issues.
This commit adds an experimental engine for processing these requests from a queue with a persistent thread instead.
Unlike inbound processing, there are no network requests in this processing that might hold the thread up for a long time.
Early implementation - currently only one thread which may (or may not) get overloaded with requests.  Added for testing purposes.
2014-09-04 18:50:29 +01:00
Justin Clark-Casey (justincc) 0cd4320cbd Make LLUDPServer.Scene publicly gettable/privately settable instead of protected so that other logging code in the clientstack can record more useful information
Adds some commented out logging for use again in the future.
No functional change.
2014-09-04 18:50:26 +01:00
Kevin Cozens 9a42589837 Prevent exception if inventory item in llGiveInventory() call doesn't exist. 2014-09-04 18:50:22 +01:00
Justin Clark-Casey (justincc) d0ed6ed86e Don't allow the last behavior to be removed from a pCampbot bot
If you want to stop existing behavious, add the None behaviour.
2014-09-04 18:50:11 +01:00
Justin Clark-Casey (justincc) 940c79a66d Resolve a small race condition on removing bot behaviours that might leave previous behaviour active
Also closes behaviours on disconnect instead of interrupt, though this makes no practical difference.
If existing behaviour is None, other added behavious will not take affect until None is removed (as this is an infinite wait until interrupted).
2014-09-04 18:50:06 +01:00
Justin Clark-Casey (justincc) 72be9eaa8b If a user moves back in sight of a child region before the agent has been closed on teleport, don't unnecessarily resend all avatar and object data about that region. 2014-09-04 18:50:02 +01:00
Justin Clark-Casey (justincc) ad1b5959d3 On teleport to a region that already has a child agent established (e.g. a neighbour) don't resend all the initial avatar and object data again.
This is unnecessary since it has been received (and data continues to be received) in the existing child connection.
2014-09-04 18:49:59 +01:00
Justin Clark-Casey (justincc) 4ec5349192 Make RootTerseUpdatePeriod and ChildTerseUpdatePeriod configurable in [InterestManagement] in OpenSim.ini for experimental purposes.
If n > 1 for RootTerseUpdatePeriod only every n terse update is actually sent to observers on same region, unless velocity is effectively zero (to stop av drift).
If n > 1 for ChildTerseUpdatePeriod only every n terse update is sent to observers in other regions, unless velocity is effectively zero.
Defaults are same as before (all packets are sent).
Tradeoff is reduction of UDP traffic vs fidelity of observed av mvmt.
Increasing n > 1 leads to jerky observed mvmt immediateley for root, though not on child, where experimentally have gone to n = 4 before jerkiness is noticeable.
2014-09-04 18:49:44 +01:00
Justin Clark-Casey (justincc) 045e644824 Make some existing reprioritization values changeable outside the scene for test purposes, and use more consise property syntax.
No functional change.
2014-09-04 18:49:30 +01:00
Justin Clark-Casey (justincc) bd54798923 On entity transfer of scene presence, replace polling sleep in SP.WaitForUpdateAgent() with a triggered event instead.
Rapid polls are more expensive than triggered events (several polls vs one trigger) and may be problematic on heavily loaded simulators where many threads are vying for processor time.
A triggered event is also slightly quicker as there is no maximum 200ms wait between polls.
2014-09-04 18:49:23 +01:00
Justin Clark-Casey (justincc) 5360cd4247 Remove redundant origin region lock in SP.CompleteMovement()
This is already going to be correctly set by WaitForUpdateAgent() earlier on in that method, which is always called where a callback to the originating region is required.
2014-09-04 18:49:18 +01:00
Justin Clark-Casey (justincc) d66e264e50 Only set up the UnackedMethod for an outgoing message if that message is actually meant to get an ack (because it's reliable). 2014-09-04 18:49:13 +01:00
Justin Clark-Casey (justincc) 238c51329e Terminate 'nothing' behaviour (and potentially others) by signalling using an event rather than polling connection state every 100ms
This kind of polling is very expensive with many bots/polling threads and appears to be the primary cause of bot falloff from the client end at higher loads.
Where inbound packet threads can't run in time due to contention and simulator disconnect timeout occurs.
2014-09-04 18:49:06 +01:00
Justin Clark-Casey (justincc) 605da59ed3 Change RootRotationUpdateTolerance from 0.01 to 0.1 in code as well. 2014-09-04 18:48:37 +01:00
Justin Clark-Casey (justincc) 70ca01283e Reduce default rotation AgentUpdate output sensitivity to a setting that cuts down UDP traffic without obvious adverse effects on observed avatar rotations.
Experimentally, on the Linden Lab grid the avatar can rotate slightly before triggering AvatarUpdates, whereas this is practically impossible in OpenSimulator.
These updates allow other avatars to see rotations, though sensitivity is low since other avatars can only be seen in one of 8 body rotations.
This commit changes sensitivity from 0.01 to 0.1, which better matches LL and reduces UDP traffic which has a beneficial impact on network and CPU load.
This has no impact on rotations in the simulator itself so simulation fidelity is the same as before.
To change this setting back for test/other purposes, edit RootRotationUpdateTolerance in the [InterestManagement] section of OpenSim.ini
2014-09-04 18:48:29 +01:00
Justin Clark-Casey (justincc) ba5f6fdfad Add RootPositionUpdateTolerance, RootRotationUpdateTolerance, and RootVelocityUpdateTolerance parameters to [InterestManagement] in OpenSimDefaults.ini
These govern when AgentUpdates are sent to observers on position, rotation and velocity changes to an avatar (including the avatar themselves).
Higher values reduce AgentUpdate traffic but at a certain level will degrade smoothness of avatar and perceived avatar movement.
2014-09-04 18:48:02 +01:00
Justin Clark-Casey (justincc) 59a79f52b3 refactor: Rename recent new Client*UpdateTolerance to Root*UpdateTolerance for better accuracy and consistency with other similar parameters 2014-09-04 18:47:58 +01:00
Justin Clark-Casey (justincc) 4443e05d5d Go back to disconnecting bots in parallel since serially is too slow.
However, disconnecting now halts any current connection, with the possible exception of the single currently connecting bot.
2014-09-04 18:47:48 +01:00
Justin Clark-Casey (justincc) 04cb9bc4bf Put pCampbot "disconnect" command on separate thread like "connect" so that we can continue to run status commands whilst bots are disconnecting. 2014-09-04 18:47:41 +01:00
Justin Clark-Casey (justincc) 9fe282f902 Allow "show bots" pCampbot console command to quickly report status by not locking entire bot list for almost 100% of connection time. 2014-09-04 18:47:36 +01:00
Robert Adams 588a3b91c5 BulletSim: thread safe handling of list of avatars.
Fix for 7284 which is an enumeration exception when starting up a region.
2014-09-04 18:46:29 +01:00
Justin Clark-Casey (justincc) d19126207e Implement "scene debug set root-upd-per" for dropping 1 in N root agent updates except to originator
For experimental purposes.
Also corrects a previous bug where each terse update sent was counted rather than each set of terse updates to agents.
2014-09-04 18:45:55 +01:00
Justin Clark-Casey (justincc) 6757633f12 Add debug mechanism for only sending 1 in N AgentUpdate packets to child agents.
Allows experiments in manually reducing updates under heavy load.
Activated by "debug scene set client-upd-per" console command.
In a simple test, can send as few as every 4th update before observed movement starts becoming disturbingly rubber-banded.
2014-09-04 18:45:50 +01:00
Justin Clark-Casey (justincc) 71d425c07c Add "debug scene set appear-refresh true|false" to control whether periodic appearance refresh is active.
Corresponds to ResendAppearnceUpdates setting in [Appearance] in OpenSim.ini
This was originally implemented to alleviate cloud appearance problems but could be too expensive with large numbers of avatars.
2014-09-04 18:45:40 +01:00
Justin Clark-Casey (justincc) cc149a95e7 Make it possible to change avatar position update, rotation and velocity tolerances on the fly.
This is done via "debug scene set client-pos-upd, client-rot-upd, client-vel-upd".
For testing purposes.
2014-09-04 18:45:34 +01:00
Justin Clark-Casey (justincc) 01bd3a8632 Allow the "debug scene set physics false|true" command to work when bulletsim physics is running in a separate thread.
This will also allow the "disable physics" setting in the region debug viewer dialog to work in this circumstance.
2014-09-04 18:45:29 +01:00
Justin Clark-Casey (justincc) 8938bc6905 minor: make "debug scene set" usage command accurate again from last commit f6f7585 2014-09-04 18:45:24 +01:00