Page MenuHomePhabricator

Request creation of statanalyser project
Closed, ResolvedPublic

Description

Project Name: statanalyser

Wikitech Usernames of requestors: Leaderboard

Purpose: For running statistical analysis on Wikimedia projects

Brief description:

I run various statistical analysis on Wikimedia projects using scripts I've created, one of which is https://github.com/Leader-board/Wikimedia-statistics/tree/main/Global%20user%20table%20generator. I've tried using Toolforge and the grid, but the issues are that

  • it seems to stop for long periods of time, apparently because it's "overloaded"
  • it will eventually crash with an "out of memory" error. If I ask the grid to allocate more than ~17 GB of memory, it will queue endlessly (meaning my script won't get a chance to run)

The latter is the main problem; my scripts can be very memory-hungry (since it needs to work with up to a 69 million x 943 matrix) and I estimate (from past tests) that I would require up to 100 GB of memory. I was told by "arturo" that I would need to request a Cloud VPN. I was also told that this is likely to be problematic.

How soon you are hoping this can be fulfilled: As soon as possible.

Related Objects

Event Timeline

Leaderboard renamed this task from Request creation of <PROJECT-NAME> VPS project to Request creation of statanalyser project.Oct 31 2022, 12:32 PM

A single report that requires 100GB of RAM to generate seems like a opportunity for optimization.

The default quota for a project is 16GB of RAM, so splitting out into your own project is not going to get you closer to running a 100GB report automatically. You will need more than 6.25 times the default project quota and a custom flavor (description of an instance) to attempt managing a 100GB heap with your java process.

At first glance, you appear to be using bufferedreads and streams, but I agree that there must be a optimization or two that will enable these statistics to run in a smaller environment. I'm not a java expert, but it would be interesting to understand what is being held entirely in memory that needs 100 GB. I would encourage you to profile the application and make sure it's acting as you expect. Alternatively, batching might be a short-term solution to limit the size of work being processed at one time and then later combining the results.

Would you like a project with the default quota?

I would encourage you to profile the application and make sure it's acting as you expect

I have done that.

it would be interesting to understand what is being held entirely in memory that needs 100 GB

The global user matrix. There are about 69 million users, and each of them can have an account on up to 941 wikis. The number of elements in that matrix is itself ~6.5 billion.
Do I need to work with this full matrix? In some cases yes, such as when finding correlation.

Regarding optimisation: one way is to shift the bottleneck (from RAM to disk), but I think that would drastically increase the time to the extent that it wouldn't be feasible. As it currently stands my code takes two days to completely execute (when run on a university server) due to the output table being ~120 GB.

Would you like a project with the default quota?

What exactly would that be? https://wikitech.wikimedia.org/wiki/Help:Cloud_VPS_Instances suggests that the maximum RAM I can have that way is 36 GB.

The default quota is 16G of RAM. Higher project quotas are possible with justification. You're correct that we don't have 100GB+ RAM instances. That's a large amount of resources for a single vm / container. However, it sounds like the toolforge environment is working for you, apart from the memory limitations. If that's correct, a cloud VPS project default quota won't improve things, and will also require you to maintain the environment.

Are there other collaborators or maintainers for this work? Can you explain more about the need for these statistics and their use cases?

However, it sounds like the toolforge environment is working for you, apart from the memory limitations.

That's true. If grid could support 100GB projects that would be enough.

Are there other collaborators or maintainers for this work?

No

Can you explain more about the need for these statistics and their use cases?

Is there an update to this request?

This was discussed some. I believe the main view was that the request that can be filled is mostly the same as what would be offered in toolforge. Which is mostly that we can't offer an instance with 100GB+ of RAM in cloud VPS or elsewhere. Thus, in this case, if this won't work in toolforge, we probably can't support it in cloud VPS either. @nskaggs could you comment further?

@Leaderboard I'm sorry, I was ill for a few days and was unable to reply to you. We cannot allocate that much memory to a single instance on Toolforge or within Cloud VPS. Given your answers to the questions I asked, it does sound like Toolforge is the correct place for this tool. We can adjust the tool quota to give you more memory than the default, however, I think you've already discovered the working limit of 16G within Toolforge.

So for this specific project request to create a new project, I would say no. A cloud VPS project also won't allow for a single VM to contain the amount of memory you are requesting.

I do wish you the best on your project. Thank you for your work within the movement! If there is something further we can help with, please let us know.

I'm going to change the status to declined, but feel free to re-open if you have more to discuss or open a new ticket if you have an alternative request. Thanks!

@nskaggs

I have managed to optimise my code so that it now runs with ~20-23 GB of memory. However this still runs into Toolforge issues; is there a way around that? I see that Cloud VPS has a 36 GB RAM instance which should be enough.

Hi @Leaderboard the flavor with 36 GB was actually created due to an arithmetic error and is in the slow process of being removed. Would you be alright with a 32GB instance? If so I believe there would be no issue in creating a project with a 32 GB quota. Would that be alright?

• rook changed the task status from Open to In Progress.Jan 10 2023, 7:59 PM
• rook claimed this task.

All set!

openstack project create --description 'statanalyser' statanalyser --domain default
openstack role add --project statanalyser --user leaderboard projectadmin
openstack role add --project statanalyser --user leaderboard user
openstack quota set --ram 32768 statanalyser

@rook One more thing - is it possible to increase the disk limit to ~200 GB? This is because I did not know that I cannot access Toolforge data from Cloud VPS (Wikitech didn't give any such indication), and while my data is highly compressible, I need the initial temporary space to hold them. Apologies for reopening again (I didn't know whether I should have created a new request instead).

Can do!

root@cloudcontrol1005:~# openstack quota set --gigabytes 200 statanalyser