Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceeding Memory Limit During Measure Calculation #155

Open
npm526 opened this issue Feb 27, 2019 · 5 comments
Open

Exceeding Memory Limit During Measure Calculation #155

npm526 opened this issue Feb 27, 2019 · 5 comments

Comments

@npm526
Copy link

npm526 commented Feb 27, 2019

I have been receiving the following error when calculating the aggregate measure calculation.

"Exceeded memory limit for $group, but didnt allow external sort. Pass allowDiskUse:true to opt in"

I am trying to calculate measures for a patient population of approximately 250,000 patients and using the measure calculation API. Has anyone seen this error? Is there a way to set this parameter while using the measure calculation API?

@lrasmus
Copy link

lrasmus commented Feb 27, 2019

@npm526 you will have to modify pophealth, the health-data-standards gem and quality-measure-engine gem for this to work. When you're making aggregate calls in mongo, you will need to set the extra parameter. For example, this line:
https://github.com/OSEHRA/popHealth/blob/master/app/models/patient_cache.rb#L61

Should be changed to read:
Mongoid.default_client.command(aggregate: 'patient_cache', pipeline: pipeline, allowDiskUse: true)['result']

@petercyli
Copy link
Collaborator

Hi Luke,
Any reason why this shouldn't be a default setting when making aggregate calls in mongo?

Thanks.

@lrasmus
Copy link

lrasmus commented Feb 27, 2019

Probably worth making it the default now. At the time when I found it, the install guide was using an older version of MongoDB, and this option was only introduced in 2.6 (https://docs.mongodb.com/manual/reference/command/aggregate/)

@petercyli
Copy link
Collaborator

Hi Nick,
Can you verify that the fix as suggested by Luke works for you? If so, can you create a pull request with the updated file, and I will merge the code to the master.
Peter

@npm526
Copy link
Author

npm526 commented Mar 13, 2019

I have implement this fix locally and it has fixed the issue. I submitted the pull requests to the health-data-standards gem, quality-measure-engine gem and popHealth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants