This site is an archive; learn more about 8 years of OpenHatch.

[OH-Dev] For the /people/ map: I've seen things you would not believe

Asheesh Laroia asheesh at asheesh.org
Thu Jan 5 22:05:05 UTC 2012


Excerpts from Asheesh Laroia's message of Thu Jan 05 16:42:05 -0500 2012:
> Hey all,
> 
> I noticed the map at /people/ never loads.
> 
> Research indicates that the problem occurs when getting the location data 
> API endpoint, whose URL looks like this:
> 
> http://openhatch.org/+profile_api/location_data/?person_ids=2585,6691,430,...
> 
> Actually it lists all of the person IDs of all nearly 7000 registered 
> users of the site.
> 
> That URL has at least two problems:
> 
> 1) This location_data API endpoint does at least one SQL query (or cache 
> lookup) query per user, which is just far too much. Now (as of 
> 748b7db71b941cf9728dfb6254dbb8935d262c2b ) it does only one query at all, 
> and the test suite enforces this. (Yay!)
> 
> 2) It is almost a 32KiB URL, which Apache (which we serve the site 
> through: mod_wsgi -> Apache -> nginx) refuses to respond to.
> 
> I'm going to add a small bit of code so that these long lists of IDs 
> are replaced by ranges. That should shrink the URL down to manageable 
> size.

This second issue is fixed.

Cache-cold, it takes 60 seconds to load this URL:

http://openhatch.org/+profile_api/location_data/?person_ids=1,3,5,7-8,12,15-17,19-22,24,28,31-35,37-38,41,43-47,49,52-53,60-62,67-69,71-72,75,77,81-82,84,86,89,92-116,118-135,137-151,154-227,229-252,254-281,284-379,381-415,417-507,509-1089,1091-1123,1125-1609,1611-2901,2963-3137,3139-4736,4738-4740,4742-4747,4749-4752,4754-4757,4759,4761-4766,4768-4771,4773,4776-4786,4788-4791,4793,4795-4797,4800,4802-4803,4806-4807,4809-4812,4816-4817,4819,4821,4823-4826,4829-4831,4834-4835,4841,4848,4850,4852-4853,4856,4860-4861,4863-4864,4866,4871-4872,4874,4876-4877,4880-4884,4886-4890,4892-4895,4897-4898,4900-4907,4911-4912,4914-4916,4919-4922,4926-4928,4930,4932-4934,4936,4938-4940,4942-4943,4945-4947,4949-4952,4955-4957,4959,4961-4964,4966,4970-4979,4981-4982,4986-4987,4989-4994,4996,4999-5001,5003,5008,5013-5015,5017,5020-5023,5025-5027,5029-5032,5034-5037,5039-5042,5044-5046,5048-5166,5169,5178,5182,5184-5185,5188-5191,5193-5196,5198,5200-5201,5204,5208-5209,5211,5213-5214,5216,5222-
 5224,5227,5230,5234,5236,5238,5241,5243-5245,5247-5249,5252-5253,5259,5263-5264,5270,5272,5274,5279,5282-5283,5287,5290,5292,5294,5297,5300-5331,5333-5334,5338-5342,5344-5345,5348-5351,5355-5357,5361-5362,5364,5366-5369,5373,5375-5378,5382-5383,5385-5386,5388-5389,5391,5393-5396,5398,5401-5403,5405-5408,5410,5413-5414,5416-5417,5419-5420,5422,5424,5426,5428,5431-5433,5435-5437,5439,5442-5444,5446-5450,5452,5454,5456,5458-5459,5461,5463-5466,5470-5475,5478,5480,5482,5484,5489,5492-5493,5498-5499,5501,5503,5505,5510,5512,5514,5518,5520-5540,5542-5550,5552-5559,5561-5564,5566-5570,5574,5576-5590,5593-5595,5597-5602,5604,5606-5609,5613,5616-5618,5620-5621,5623-5624,5626-5629,5632,5634-5639,5641-5659,5661-5668,5670-5673,5675-5678,5680-5687,5689,5691-5697,5699-5710,5712-5720,5722,5725-5739,5741-5748,5750-5752,5754-5757,5760-5763,5765-5767,5769-5775,5777-5780,5782-5783,5785-5789,5791-5792,5794-5802,5804,5806-5819,5821-5833,5835,5837,5839-5842,5844-5845,5847-5850,5852,5854-5855,5857
 ,5859-5864,5866-5898,5900-5906,5908-5911,5913-5920,5922-5923,5925-5933,5935-5936,5938-5946,5948-5953,5955-5959,5961,5963-5986,5988-6016,6018-6023,6025,6027,6029-6036,6038-6039,6043-6044,6046-6049,6052-6062,6064,6066-6085,6087-6098,6100,6102-6130,6132-6138,6140-6141,6143-6148,6150-6151,6153-6155,6157-6159,6161-6165,6167-6170,6172,6174,6176-6178,6180,6182,6185-6187,6189-6190,6193-6233,6235-6237,6239-6247,6249,6251,6253,6255-6257,6259-6267,6269-6275,6277-6283,6285-6293,6295,6297-6317,6319-6337,6339-6430,6432-7190,

Cache-warm, it takes 5 seconds.

5 sec is almost a reasonably good amount of time. I'll call that okay
for now.

-- Asheesh.


More information about the Devel mailing list