Skip to content

Conversation

@ramonfigueiredo
Copy link
Collaborator

@ramonfigueiredo ramonfigueiredo commented Aug 7, 2024

  • Add the render host's total_mem, total_swap in the initMachineStats function.
  • Specify file encoding when opening /proc/meminfo.

This logic was removed on 18/Dec/2018 at 11:04 in the pull request: Add build and packaging for RQD. (#48), cfd6e6b

@ramonfigueiredo
Copy link
Collaborator Author

Fixed swap memory on RQD

Now the CueGUI (cuecommander) > Monitor Hosts is showing the swap bar animation:

  • Swap bar animation: The amount of used swap (red) vs available swap (green)

Cue Commander > "Monitor Hosts": Swap bar not working

swap_bar_not_working

Cue Commander > "Monitor Hosts": Swap bar working

  • Free swap memory available (green bar)

free_swap_mem_available-green_bar

  • Free swap memory used (green and red bar)

free_swap_mem_used-green_and_red_bar

@ramonfigueiredo
Copy link
Collaborator Author

ramonfigueiredo commented Aug 7, 2024

This PR fixes the swap memory on Linux! The swap memory is working on MacOS and Windows.

The Opencue DB host_stat table has the values int_swap_free and int_swap_total.

Linux fix:

Basically, the Opencue RQD is getting the information from /proc/meminfo :

SwapCached:            0 kB
SwapTotal:      209715196 kB
SwapFree:       209715196 kB

@ramonfigueiredo ramonfigueiredo marked this pull request as draft August 7, 2024 23:54
- Add the render host's total_mem, total_swap in the initMachineStats function.

This logic was removed on 18/Dec/2018 at 11:04 in the pull request: Add build and packaging for RQD. (#48), cfd6e6b
@ramonfigueiredo ramonfigueiredo changed the title [rqd] Fix swap memory on RQD [rqd] Fix swap memory on Linux Aug 8, 2024
@ramonfigueiredo ramonfigueiredo marked this pull request as ready for review August 8, 2024 00:06
@ramonfigueiredo ramonfigueiredo marked this pull request as draft August 8, 2024 00:08
- This commit addresses the linting warning (W1514) by explicitly specifying the UTF-8 encoding when opening /proc/meminfo.
- This ensures the file is read correctly and resolves the warning in the GitHub pipeline."
- Using `codec.open` with the specified encoding will work in both Python 2 and Python 3.
@ramonfigueiredo ramonfigueiredo marked this pull request as ready for review August 8, 2024 00:42
@lithorus
Copy link
Collaborator

Wouldn't it be better to use psutils for this? We're already using AFAIK.

@ramonfigueiredo
Copy link
Collaborator Author

ramonfigueiredo commented Aug 12, 2024

Wouldn't it be better to use psutils for this? We're already using AFAIK.

Hi @lithorus,

I agree we can use psutils as well. But I followed the current code, kept the use of /proc/meminfo, and fixed only the swap memory. For me, we can migrate to psutils later, if necessary. Unless you think it is an essential change to be migrated now.

This is the current version that is fixed and tested on our side.

@lithorus
Copy link
Collaborator

Yes, probably for the best to keep as it is for now and make a seperate PR for replacing it with psutils

@ramonfigueiredo
Copy link
Collaborator Author

Yes, probably for the best to keep as it is for now and make a seperate PR for replacing it with psutils

Ok, let's keep it like that for now. Thanks!

@ramonfigueiredo ramonfigueiredo merged commit 857dd3b into AcademySoftwareFoundation:master Aug 14, 2024
@ramonfigueiredo ramonfigueiredo deleted the fix-swap-memory branch October 15, 2024 17:06
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

Successfully merging this pull request may close these issues.

3 participants