我在應用程序中看到了一些平常的事情。沒有理由,當我的流量很少或沒有時,我的服務器會變慢。經過大量的反覆試驗,我發現我的問題在我的TastyPie資源上刪除了ToOneField
後消失了!如何停止TastyPie無緣無故地進行UPDATE查詢?
我發現是因爲某些未知原因TastyPie正在做數據庫更新對這些ToOneFields沒有很好的理由!什麼......時刻!
我發現提起here一個可能的錯誤,聲稱已經解決了這一問題的更新。我已經安裝了從pip
的最新版本,但仍然看到此問題。
任何人都可以幫忙嗎?
class IncentiveResource(ModelResource):
product_introducer = fields.ToOneField(ProductResource, 'referrer_product', full=True)
product_friend = fields.ToOneField(ProductResource, 'referee_product', full=True)
class Meta:
queryset = Incentive.objects.all().order_by('-date_created')
resource_name = 'incentive'
allowed_methods = ['get']
authentication = MultiAuthentication(ClientAuthentication(), ApiKeyAuthentication())
authorization = Authorization()
filtering = {
"active": ALL,
}
always_return_data = True
cache = SimpleCache(cache_name='resources', timeout=10)
這裏流量很少,但變得無法使用。
上面顯示的性能分析輸出......使用什麼工具? – 8one6
@ 8one6這是新的文物 – Prometheus