使用 .Take() 时 Azure 表存储中的数据访问时间奇怪
这是我们的情况:
我们将用户消息存储在表 Storage 中。 Partition key 是 UserId,RowKey 用作消息 id。
当用户打开他的消息面板时,我们只想获取 .Take(x) 条消息,我们不关心排序顺序。但我们注意到,获取消息所需的时间因我们获取的消息数量而异。
我们做了一些小测试: 我们做了 50 * .Take(X) 并比较了差异: 所以我们做了 .Take(1) 50 次和 .Take(100) 50 次等等。
为了进行额外的检查,我们做了同样的测试 5 次。
以下是结果:
正如您所看到的,存在一些巨大的差异。 1和2之间的差异很奇怪。 199-200也一样。
有人知道这是怎么发生的吗?顺便说一句,表存储位于实时服务器上,而不是开发存储上。
非常感谢。
X: # 需要 Y:测试编号
更新 这个问题似乎只在我使用无线网络时才会出现。但我用的是有线的,时间很正常。
this is our situation:
We store user messages in table Storage. The Partition key is the UserId and the RowKey is used as a message id.
When a users opens his message panel we want to just .Take(x) number of messages, we don't care about the sortOrder. But what we have noticed is that the time it takes to get the messages varies very much by the number of messages we take.
We did some small tests:
We did 50 * .Take(X) and compared the differences:
So we did .Take(1) 50 times and .Take(100) 50 times etc.
To make an extra check we did the same test 5 times.
Here are the results:
As you can see there are some HUGE differences. The difference between 1 and 2 is very strange. The same for 199-200.
Does anybody have any clue how this is happening? The Table Storage is on a live server btw, not development storage.
Many thanks.
X: # Takes
Y: Test Number
Update
The problem only seems to come when I'm using a wireless network. But I'm using the cable the times are normal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
数据可能是按一定数量 x 的批次收集的。当您请求 x+1 行时,必须分两批,然后删除一定数量。
尝试使用 Take() 参数以 1 为增量运行测试,以确认或驳回此假设。
Possibly the data is collected in batches of a certain number x. When you request x+1 rows, it would have to take two batches and then drop a certain number.
Try running your test with increments of 1 as the Take() parameter, to confirm or dismiss this assumption.