I have an Alfresco One v5.1.3 configured with 6 ContentStores (6 S3ContentStores).
From time to time, reading is very slow (40-50 seconds).
I debugged. The problem is that when a read occurs, every ContentStore is interrogated for the object in the request (in the order defined by contentStoreSelector). Also, reading is not slow every time because there is a cache used for these requests (a cache in the Alfresco code, I mean).
Important note 1: the S3 storage is respoding very quickly to requests.
Important note 2: the Alfresco S3 Connector has the number of retries set to 5, so every ContentStore is actually interrogated 6 times; that's why reading becomes very slow (40-50seconds). The number of retries is hardcoded in the connector, no way to configure it "outside".
More detailed & technical information:
- When a read occurs, the selectReadStore is called (AbstractRoutingContentStore class). You can see the iteration I'm talking about in selectReadStore. You can also see the caching at the beginning of selectReadStore.
- When a write operation occurs, the selectWriteStore is called (StoreSelectorAspectContentStore class). In selectWriteStore, the proper ContentStore is selected using cm:storeName.
Q1: Why is cm:storeName not used by selectReadStore, too? Why is Alfresco iterating through ContentStores, when it's clear from cm:storeName which ContentStore is holding the requested object?
Q2: Is there something we can do to speed things up (besides making use of just 1 S3ContentStore, so no iteration is needed)? The slow reading seems to happen pretty often, despite the cache in selectReadStore (I have not made sufficient tests to actually tell you how often).