Commit Graph

21333 Commits (8acb86306045c0495ffe191f08d21c1c08e0a989)

Author SHA1 Message Date
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
Justin Clark-Casey (justincc) 1b037c8e8e Add a "debug scene set child-repri <double>" command that allows child reprioritization distance to be changed on the fly.
This governs when child agent position changes are sent to neighbouring regions.
Corresponding config parameter is ChildReprioritizationDistance in [InterestManagement] in OpenSim.ini
For test purposes.
2014-09-04 18:45:15 +01:00
AliciaRaven 058861ec70 Include option to remove auto backup files older than given number of days. New property created to specify how many days to keep files for. Off by default, also made sure only oar files will be removed. 2014-09-04 18:38:41 +01:00
Justin Clark-Casey 4a90dd3556 Change 0.8-post-fixes branch back to Post_Fixes flavour 2014-08-23 00:02:12 +01:00
Justin Clark-Casey f6d02a63eb Change 0.8 post fixes branch to version 0.8.0.1 with release flavour. 2014-08-22 20:19:16 +01:00
Oren Hurvitz 422f718949 Fixed crash when using Allowed/Denied Viewers, and the viewer's name is shorter than one of the test strings
This fixes http://opensimulator.org/mantis/view.php?id=7294
2014-08-22 19:20:19 +01:00
Oren Hurvitz 3176237169 Fixed premature closing of the connection in DataSnapshotManager 2014-08-08 20:46:59 +01:00
Justin Clark-Casey (justincc) a4595b18ca Make currently unfiltered EventQueue log messages only appear now at DebugLevel 1
This covers event queue setup messages and some outgoing messages (e.g. EnableSimulator)
In my experience these messages are only useful if you really know what they mean and you're looking for them
Otherwise, they're quite spammy.
Event queue DebugLevel 1 is enabled with the "debug eq 1" console command
2014-08-05 00:51:17 +01:00
Justin Clark-Casey 4640281e57 Add conflict resolution that should have been done in conflict resolution of 4e3a2d3a64 2014-08-02 01:04:58 +01:00
Justin Clark-Casey (justincc) 319bbce517 If REMOVEAGENTFROMGROUP core groups call fails because requesting agent does not have sufficient permission, return null failure result rather than true.
On non-HG this is on the only recognized failure state so we can return more information in the error result.
On HG there are multiple failure states which would require more work to distinguish, so currently return the unsatisfying "Internal Error" like some other existing calls.
2014-08-02 00:58:37 +01:00
Justin Clark-Casey (justincc) a48b3ef97a Don't overwrite the null result with the true result is groups service REMOVEAGENTFROMGROUP call has failed because of missing parameters 2014-08-02 00:58:33 +01:00