# Optimizing Web Applications

This page intends to provide some guidance in optimizing web applications. Please refer to the [Web Application optimization pack](/akamas-docs/3.3.1/akamas-reference/optimization-packs/web-application-pack.md) for the list of component types, parameters, metrics, and constraints.

### Telemetry configuration <a href="#telemetry-configuration" id="telemetry-configuration"></a>

No specialized telemetry solution to gather *Web Application* metrics is included. The following providers however can integrate with the provided metrics:

* [CSV File Provider](/akamas-docs/3.3.1/integrating-akamas/integrating-telemetry-providers/csv-provider.md): this provider can be configured to ingest data points generated by any monitoring application able to export the data in CSV format.
* integrations leveraging [NeoLoad Web](/akamas-docs/3.3.1/integrating-akamas/integrating-telemetry-providers/neoloadweb-provider.md), [LoadRunner Professional](/akamas-docs/3.3.1/integrating-akamas/integrating-telemetry-providers/loadrunner-professional-provider.md) or [LoadRunner Enterprise](/akamas-docs/3.3.1/integrating-akamas/integrating-telemetry-providers/loadrunner-enterprise-provider.md) as a load generator can use this ad-hoc provider that comes out of the box and uses the metrics defined in this optimization pack.

### Workflows <a href="#workflow-design" id="workflow-design"></a>

#### Applying parameters <a href="#applying-parameters" id="applying-parameters"></a>

The provided component type does not define any parameter. The workflow will optimize parameters defined in other component types representing the underlying technological stack.

#### A typical workflow <a href="#a-typical-workflow" id="a-typical-workflow"></a>

A typical workflow to optimize a web application is structured in three parts:

1. **Configure and restart the application**
   1. Use the [FileConfigura operator](/akamas-docs/3.3.1/akamas-reference/workflow-operators/fileconfigurator-operator.md) to interpolate the tuned parameters in the configuration files of the underlying stack.
   2. Restart the application using an [Executor operator](/akamas-docs/3.3.1/akamas-reference/workflow-operators/executor-operator.md).
   3. Wait for the application to come up using the [Sleep](/akamas-docs/3.3.1/akamas-reference/workflow-operators/sleep-operator.md) or [Executor operator](/akamas-docs/3.3.1/akamas-reference/workflow-operators/executor-operator.md).
2. **Run the test**
   1. use any of the [available operators](/akamas-docs/3.3.1/akamas-reference/workflow-operators.md) to trigger the execution of the performance test against the application.
3. **Perform the cleanup**
   1. use any of the [available operators](/akamas-docs/3.3.1/akamas-reference/workflow-operators.md) to restore the application to the original state.

Here's an example workflow to perform a test on a Java web application using NeoLoad as a load generator:

```yaml
name: "webapp workflow"
tasks:
  - name: Set Java parameters
    operator: FileConfigurator
    arguments:
      source:
        hostname: myapp.mycompany.com
        username: ubuntu
        key: # ...
        path: /home/ubuntu/conf_template
      target:
        hostname: myapp.mycompany.com
        username: ubuntu
        key: # ...
        path: /home/ubuntu/conf

  - name: Restart application
    operator: Executor
    arguments:
      command: "/home/ubuntu/myapp_down.sh; /home/ubuntu/myapp_sh -opts '/home/ubuntu/conf'"
      host:
        hostname: myapp.mycompany.com
        username: ubuntu
        key: # ...

  - name: Run NeoLoadWeb load test
    operator: NeoLoadWeb
    arguments:
      accountToken: NLW_TOKEN
      projectFile:
        # NeoLoad projectfile location ...
```

### Examples

See this [page](/akamas-docs/3.3.1/knowledge-base/optimizing-a-web-application.md) for an example of a study leveraging the Web Application pack.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akamas.io/akamas-docs/3.3.1/using-akamas/using-optimization-packs/web-application-pack.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
